Hi everyone:
I am creating a program that requires registration, so I am attempting to write all the user information into the Windows Registry under HKEY_LOCAL_MACHINE key for it to be accessible if my program is run from every user account on that machine. Everything works great until a user logs on that doesn't have administrative privileges (like a Guest account on Windows XP). In this case RegCreateKeyEx API returns ERROR_ACCESS_DENIED and my program returns an error. I tried searching on-line but didn't find any way to overcome this issue?
Here's a code example of how I open my registry key:
What am I doing wrong? Should I use some other way to store registration specific data?
Thank you in advance...
I am creating a program that requires registration, so I am attempting to write all the user information into the Windows Registry under HKEY_LOCAL_MACHINE key for it to be accessible if my program is run from every user account on that machine. Everything works great until a user logs on that doesn't have administrative privileges (like a Guest account on Windows XP). In this case RegCreateKeyEx API returns ERROR_ACCESS_DENIED and my program returns an error. I tried searching on-line but didn't find any way to overcome this issue?
Here's a code example of how I open my registry key:
Code:
LONG nRes = RegCreateKeyEx(HKEY_LOCAL_MACHINE, pKeyName, NULL, _T(""), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &nDisp);
What am I doing wrong? Should I use some other way to store registration specific data?
Thank you in advance...