Hi,
Is there any wx function to get the registration serial number of the running MS Windows OS?
Marcus
Get Windows serial number Topic is solved
-
- Experienced Solver
- Posts: 79
- Joined: Thu Sep 25, 2008 12:14 am
Re: Get Windows serial number
No, you will have to use system specific api's. To keep it as portable as possible wrap the code in ifdefs...Marcus Frenkel wrote:Hi,
Is there any wx function to get the registration serial number of the running MS Windows OS?
Marcus
Code: Select all
#ifdef WIN32
//win32 code to check serial number
#endif
-
- Earned some good credits
- Posts: 125
- Joined: Wed Mar 05, 2008 3:30 pm
Re: Get Windows serial number
Under Windows you can use:Marcus Frenkel wrote:Is there any wx function to get the registration serial number of the running MS Windows OS?
Code: Select all
wxRegKey *key = new wxRegKey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion");
key->QueryValue("ProductId", &value);
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
Re: Get Windows serial number
Two conflicting posts that say the opposite.
-
- Experienced Solver
- Posts: 79
- Joined: Thu Sep 25, 2008 12:14 am
Re: Get Windows serial number
Solution for MSW will be fine enough. Is the serial number always stored in that place of the registry regardless of the Microsoft Windows version?chris_bern wrote:Code: Select all
wxRegKey *key = new wxRegKey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion");
-
- Earned some good credits
- Posts: 125
- Joined: Wed Mar 05, 2008 3:30 pm
Re: Get Windows serial number
Win 95 - Win XP should store the product key in the same location. The following location should be more portable: "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion".Marcus Frenkel wrote:Solution for MSW will be fine enough. Is the serial number always stored in that place of the registry regardless of the Microsoft Windows version?chris_bern wrote:Code: Select all
wxRegKey *key = new wxRegKey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion");
On Vista, the same key location contains the product ID number, not the actual product key used for installation, the later is encrypted.
Chris
-
- Experienced Solver
- Posts: 79
- Joined: Thu Sep 25, 2008 12:14 am