Pelles C forum

C language => Windows questions => Topic started by: andre104 on October 03, 2007, 04:19:04 AM

Title: How to retrieve values a from registry key ?
Post by: andre104 on October 03, 2007, 04:19:04 AM
I'm playing with registry now. How to retrieve values from a registry key ?
Let's say the key is : HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

I'm looking for these 2 things :
VendorIdentifier : GenuineIntel
Identifier : x86 Family 15 Model 2 Stepping 7

So, my code will return something like this :
"Your CPU is GenuineIntel, identified as x86 Family 15 Model 2 Stepping 7".

I thinks it needs to use RegQueryValueEx, but I don't know how to use this properly.  :-\
Title: Re: How to retrieve values a from registry key ?
Post by: Stefan Pendl on October 03, 2007, 08:30:51 AM
You need RegOpenKeyEx to get the handle, RegQueryValueEx to get the information and RegCloseKey to close the handle.
The Windows Platform SDK has some useful demos or you can check MSDN.