Tuesday, March 13, 2012 12:01 PM
Tuesday, March 13, 2012 12:40 PM
Karan P Shah wrote:
I need to change a value in the registry in win 7, 64bit , The path being "HKLM/Software/Microsoft/Windows
NT/CurrentVersion/ICM/Calibration". I have to set the value of "CalibrationManagementEnabled" to 1. I am currently using
SetRegValueEx to set the value. I am getting a return value of 5. (ERROR_ACCESS_DENIED).
Only administrators can write under HKLM.
If I run my application as admin, no
error occurs, bt there is no change in the registry's intended path. Instead, a virtual path is created
Tuesday, March 13, 2012 12:56 PM
Show us your code.
If you want to modify registry without running all your program as administrator, you may write a small program which will modify the key and run it as different process from your application.
Tuesday, March 20, 2012 10:18 AM
I am using the following piece of code, this is specific to win 7
LONG result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ICM\\Calibration", 0, KEY_ALL_ACCESS , &hkey);
DWORD value = 1;
result = RegSetValueEx(hkey, L"CalibrationManagementEnabled", 0, REG_DWORD, (CONST BYTE*)(&value), sizeof(value));
the result comes as 5 which indicates access denied, If i run as admin, I get it as 1. but the registry value is set in the virtual path provided.
Monday, March 26, 2012 5:46 AM