I need to see if a value in the registry exists...
I know how to see if a subkey exists, but not a particular value within' that subkey...
any help on this would be much appreciated... thanks... Cube
Printable View
I need to see if a value in the registry exists...
I know how to see if a subkey exists, but not a particular value within' that subkey...
any help on this would be much appreciated... thanks... Cube
First open the subkey:
char myValueData[100];
DWORD myDataSize;
LONG myRegResult;
DWORD myRegType;
DWORD myOptions = 0;
myRegResult =::RegOpenKeyEx(HKEY_LOCAL_MACHINE,
PATH,
myOptions,
KEY_ALL_ACCESS,
&myRegKey);
and then get the value
myDataSize = sizeof(myValueData);
myRegResult = ::RegQueryValueEx(myRegKey,
"myKey",
NULL,
&myRegType,
(LPBYTE)myValueData,
&myDataSize);
CString myValue(myValueData);
myValue now contains the value of the given key. Hope it helps!!
Ciao, Jeep