NO

Author Topic: How to retrieve values a from registry key ?  (Read 4207 times)

andre104

  • Guest
How to retrieve values a from registry key ?
« 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.  :-\

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: How to retrieve values a from registry key ?
« Reply #1 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.
---
Stefan

Proud member of the UltraDefrag Development Team