I am using GetAdaptersInfo() to READ the NIC's Description and using it. However, I recently came to know that, someone can modify this in Windows Registry, as there is a key called Friendly Name in HKLM tree section.
For me it is somewhere in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ROOT...
My problem is, not to get into this problem and get the Description field which in not impacted by change in Friendly Name field.
Related
I was tasked to create a screen to input a description and a printer name installed on the back-end server. This facility will be used in the front-end to print documents directly to the server's installed printers. The printer name input should be validated to only accept a valid printer name.
I searched in google and was not able to find a document or post that tells what are the valid/invalid characters for Windows printer names.
I just want to confirm with the Windows guys if someone knows what exactly are the documented valid/invalid characters for printers names.
There doesn't seem to be an authoritative description in the specs however if you try and add a printer with an obviously incorrect name you get:
Clearly you need to avoid '\' and ',', it's probably a good idea to avoid '/' as well.
This post contains a list of all forbidden names in Windows. This applies to files and folders as well as device names.
I really want to make a directory to have another localized or customized name. In the other word, the directory has two name. The one is a name to be showed to user, the other is a name which is a real name used by a filesystem. It just like a SHSetLocalizedName function supported by Windows OS.
Is there a way to solve this problem?
The instructions can be found on the Apple developer pages, search for "localized folder name" (documentation).
I would like to create a "printer" that would display as an available printer when a user tries to print a document.
If this printer is used, a window will be displayed showing the available locations in the database that the document can be stored. The document will then be converted to PDF format and the resulting blob data will be inserted into the database.
I found a similar topic here: How to create own XP printer driver. However, some of the answers suggest using RedMon (which does not look like it currently supports Windows 7). The solution should be supported in Windows XP and up.
I thought I would start a new question to see if anybody has done anything more recently than that previous question.
Any help would be greatly appreciated.
Thanks.
You don't need RedMon. The top answer to the question you linked (the answer from Oleg) is precisely the answer to your question. Just take the Port Monitor sample from the WDK and modify it to do as you need. However, you will also need a print driver in order to create a printer. For that you can use the Unidriver or Postscript drivers shipped with Windows. All you'll need to provide is an .inf file that will install and name your printer appropriately and a .ppd or .gpd file to describe its characteristics. Many examples of both can be found readily in the WDK or online.
using pdfcreator or bullzip pdf as a printer to create a pdf file in a folder and then using use some folder watchers (like 'Watch4Folder') in order to trigger a script (to insert the file into a blob field), in a way that you can create several folders so you can customize the target database by choosing diferent folder where to "print" the pdf file.
Sorry for my english
Claudio
In order to find out what the default email client is, I found the same information over and over again: Look at the default string in HKLM\Software\Clients\Mail. (see for example this related question)
However, this seems not to be true for all OSs and/or situations:
I have two machines running Win7 64bit, let's call them A and B.
A has Outlook 2010 64bit and Thunderbird 3 32bit installed.
B has Outlook 2007 32bit and Thunderbird 3 32bit installed.
Both A and B have Thunderbird set as their default mail client.
However, the state of the registry is not as I expected it:
On machine A, both HKLM\Software\Clients\Mail and HKLM\Software\Wow6432Node\Clients\Mail have an empty string as the default string value.
On B, both those keys contain Microsoft Outlook as the default string value, which is clearly wrong.
Further investigation revealed that the correct value seems to be written to HKCU\Software\Clients\Mail on both machines.
I want my application to handle this correctly for all cases. It makes kinda sense, that Win7 now seems to hold a separate default mail client for each user, but it appears rather inconsistent. When looking at the plethora of information that points to HKLM\Software\Clients\Mail, it seems obvious that previous versions of Windows handled this differently and always wrote to that location. So when did this change? Has the wrong value on machine B any meaning? If not, why does it get written there in the first place? Does the mix of 64bit and 32bit email clients on the same computer change anything?
I would most appreciate if anyone would share reliable information or documentation that explains this topic! Maybe there is a Win32 API function that returns the correct value?
Does this MSDN article help you?
How to Register an Internet Browser or E-mail Client With the Windows Start Menu
Registrations made in the HKEY_CURRENT_USER subtree have higher precedence for the console user than corresponding registrations made in the HKEY_LOCAL_MACHINE. For new users on the system, the settings stored in HKEY_LOCAL_MACHINE are used.
For Windows XP a special article: How to modify the default Web browser and e-mail client programmatically in Windows XP and How to implement a per-user default mail client in Windows XP?
Sorry, can't help you with the Win32 API.
For Windows 10, this seems to be different - see the discussion here: https://superuser.com/q/1045349/176339
Quoting the relevant paragraph for your question, from papo's answer:
Registry entries for mailto protocol are under HKLM\SOFTWARE\Classes\mailto and as it is with other Classes, they could be overridden by entries for CURRENT_USER, under HKCU\SOFTWARE\Classes\mailto
BUT
There were changes in recent Windows versions and now, there are more places in registry which will further override shell associations from Classes. Moreover, in case of mailto they are mandatory and so rendering the Classes values for mailto useless.
Next in line of importance is Key:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\mailto]
which in turn is overridden by:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\UrlAssociations\mailto]
which is also used only if it's not overridden by:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto]
GOOD JOB Microsoft :)
Values under these Keys have the same format, a Key UserChoice with a ProgId valuename pointing to shell association Key from Classes.
But you can all but forget about editing these values, as there also is the Hash value. It's a protection against such registry edits.
User MUST click himself at least once to select an App on a standard Windows Open With dialog popup, if he also check the Always option, the Hash value is generated and the choice is remembered and written to last two Keys from the list above. Another option is to use the Settings as shown in the picture above.
It's a safeguard against malicious Apps, viruses and bad programmed Apps.
To troubleshoot a problem with default mailto association, you can delete mailto Keys from under all of these locations, except LOCAL_MACHINE.
Windows will re-create them on next use of the mailto protocol.
There is a Windows program which is downloaded after entering a valid serial in a web page. Now, I want to limit the user to install the program only on one single PC, the one he or she installed for the first time.
I need some advice on creating a such system. Thank you.
P.S. Serial key must be entered on the web page instead of the installer.
Sounds like you need to create a downloadable activex control program that will run on the client's machine in which it will interrogate:
MAC of network adapter
Windows Version, including SP
Hard disk serial number
Processor make and CPU type
And relay the information back to the website, then generate the key, and attach the key to the download installer and permit the user to download the installer in which the key is then read in at run-time and checked against the machine that is running on.
The only thing is the ActiveX must be written in C/C++ as you cannot do it on the .NET language as that is assuming the client's machine will have the runtime installed which IMHO is a dangerous assumption.
Hope this helps,
Best regards,
Tom.
The usual solution is:
Create a hash describing the system (don't know the exact way to get it though, GIYF) & combine it with the serial, so when the user installs the program he has to enter the serial, then gets a key he has to enter on the website which splits the entered key into the serial and the system hash and checks if the system hash and serial match the stored ones and then returns another key (or an error if the serial was already used) he has to enter into the program.
Using the Mac Adress as a system key is not a good solution as it can easily be faked.
Base the serial number on some hardware configuration. If the hardware changes, then invalidate the serial number. Microsoft windows uses this type of approach during the activation of the product.
Hope this helps some.
If you write a custom installer then you could send an acknowledgement to your web server upon successful install that sends a serial # generated from the hardware, and the serial # they used to download the file.
Then if you find the same serial # but a different hardware serial, you can send a response back saying that you could not activate the software...
EDIT
Here is some info on getting hardware info (assuming a .NET environment, but you can find similar for the environment you are using).
You could try blocking the key on install and unblocking the key when they uninstall. That way they can only use the key once between each uninstall.
set up a web service and database ... they have to validate to be able to install. the problem with your model at the moment is that you are protecting or hiding your software behind the server. You want peopel to have the software even if they cant use it (usually). the serial key stage should be there to unlock the software at runtime.
Its the only model that works for computer games.
You need to poll various pieces of hardware to generate a guid, hash it against a product key and you have a reproducible yet complex and hard to forge piece of data.
http://edn.embarcadero.com/article/26040 A link to the .com interfaces to get at the guids
an alternative would be to use something like sysinfo or dxdiag and save the rseults to a file ... hash it and use that as the serial. A lot less coding involved - but a bit messier.
Store this and issue the installation key - easy to spot and manage reinstalls then.
Ie you really don't want to go 'computer says no' - its really a marketing opportinuty