Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good afternoon members of the forum.
Faced such a problem:
When I try to print the value of the key, Install does not output anything at all

What I have tried:

C++
TCHAR lpData[1024]={0};
DWORD buffersize = sizeof(lpData);
HKEY hKey;
//

if (RegOpenKeyEx (HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client\\1034"),NULL,KEY_READ,&hKey)==ERROR_SUCCESS)
{

		if (RegQueryValueEx(hKey,TEXT("Install"),NULL,NULL,(LPBYTE) lpData,&buffersize)==ERROR_SUCCESS)
		{
			 std::wcout << lpData;
		}
		std::wcout << lpData;
}

RegCloseKey (hKey);


BUT IT WORK FINE OMG
if (RegOpenKeyEx (HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Internet Explorer\\Main"),NULL,KEY_READ,&hKey)==ERROR_SUCCESS)
{

		if (RegQueryValueEx(hKey,TEXT("Local Page"),NULL,NULL,(LPBYTE) lpData,&buffersize)==ERROR_SUCCESS)
Posted
Updated 17-May-18 0:52am
v2

1 solution

The path you are looking for is under HKEY_LOCAL_MACHINE, not under HKEY_CURRENT_USER.
 
Share this answer
 
Comments
phil.o 17-May-18 7:46am    
Good spot. My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900