Hi Folks,
I am creating an entry in registry under HKEY_CURRENT_USER\Software\App
This is the code snippet:
hr = RegCreateKeyA (HKEY_CURRENT_USER, "Software\App", &hPluginKey);
if (hr == ERROR_SUCCESS )
{
hr = RegSetValueExA (hPluginKey, NULL, 0, REG_SZ, "Default", MAX_LENGTH);
if (hr == ERROR_SUCCESS )
{
hr = RegCreateKeyA (hPluginKey, "My Plugin", &hValue);
if (hr == ERROR_SUCCESS )
{
hr = RegSetValueExA (hValue, NULL, 0, REG_SZ, "This is My Plugin",
MAX_LENGTH);
if (hr == ERROR_SUCCESS )
{
printf (("Registered Successfully."));
}
RegCloseKey (hValue);
}
}
RegCloseKey (hPluginKey);
}
THis code is executing successfully, but creating desired entry under
HKEY_USERS instead of HKEY_CURRENT_USER.
This is very strange to me cause first time I am facing such problem.
I had worked on registry many times before. But never face such bug.
OS is winXP Professional Version 2002 with SP2.
Please reply if some one has the solution.
Thanks
Regards
Rakesh
Dave Patrick - 23 Aug 2008 12:13 GMT
HKEY_CURRENT_USER is a symbolic link to a subkey of HKEY_USERS

Signature
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
> Hi Folks,
>
[quoted text clipped - 35 lines]
> Regards
> Rakesh