Archived

This topic is now archived and is closed to further replies.

reaptide

Windows Registry

Recommended Posts

Hello everyone, I''ve been thinking of messing around with the window''s registry in my program, but I can''t for the life of me, figure it out. MSDNs information is functional and I have been able to open a registry key and write a value, but I can''t seem to read a value. Google turned up a good number of article on using the registry with Visual Basic, Delphi and MFC. I was wondering if anyone may know of an article using C.

Share this post


Link to post
Share on other sites
Well I don''t know of any articles... but to read values from the registry you use RegQueryValueEx

DWORD Type = REG_DWORD;
DWORD MyValue;
DWORD Size = sizeof(MyValue);

if(RegQueryValueEx(hKey, "MyRegistryValue", NULL, &Type, (BYTE *)&MyValue, &Size) != ERROR_SUCCESS)
{
//Error occured
}

Share this post


Link to post
Share on other sites