RajaK

Hi,

I am working with win32 application. I want to read the registry key value. How can i read the key values from registry I using the below code for creating a key in registry.

HKEY hKey;
DWORD dwDisp = 0;
LPDWORD lpdwDisp = &dwDisp;
KString l_strExampleKey = key;
KString l_strStringSample = stringname, l_strStringSampleVal = stringvalue;;

LONG iSuccess = RegCreateKeyEx(rootHKEY, l_strExampleKey, 0L,NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey,lpdwDisp);


if(iSuccess == ERROR_SUCCESS)
{
RegSetValueEx(hKey, l_strStringSample, 0, REG_SZ, (LPBYTE) l_strStringSampleVal.GetBuffer(l_strStringSampleVal.GetLength()), l_strStringSampleVal.GetLength()+ 1);
}
plz , can anyone help me

Thanks in Advance!!!



Re: Visual C++ General Win32: How can i read the key values from registry?

Ramkrishna Pawar

RegQueryValueEx (Windows)




Re: Visual C++ General Win32: How can i read the key values from registry?

Marius Bancila

You can also use the code from here.




Re: Visual C++ General Win32: How can i read the key values from registry?

Nishant Sivakumar

To add to Marius' suggestion, there are also a bunch of registry wrapper and utility classes here that you might find useful :

http://www.codeproject.com/system/#Registry