Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows NT / Registry / August 2008

Tip: Looking for answers? Try searching our database.

Creating entry in HKEY_USERS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rakesh - 22 Aug 2008 13:29 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.