hi, all
I was trying to change some registry value on win7 using C++, and my code looks like this:
CRegKey cKey;
if(ERROR_SUCCESS == cKey.Open(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.htm\\UserChoice"), KEY_READ))
cout << "opened!" << endl;
if(ERROR_SUCCESS == cKey.SetStringValue(_T("Progid"), _T("110"), REG_SZ))
cout << "setted" << endl;
And of course I change the manifest file's level to "requireAdministrator".
But when I run this program, I can only see the "opened" message. It means that I can only open the registry, but cannot set the value.
Sometimes when I try to set some registry value manually, the system always said that "one or more applications may now use it" and I can't change the value.
Can someone please tell me how I can change the registry value in my project?
Is it something about the UAC level?
Any answers from you will be appreciated