#define
STR_REGUAC_PATH "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"
void CloseUAC()
{
HKEY RegKey;
RegKey=NULL;
RegOpenKey(HKEY_LOCAL_MACHINE,STR_REGUAC_PATH,&RegKey);
DWORD dwNum = 0;
RegSetValueEx(RegKey, _T("ConsentPromptBehaviorAdmin"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegSetValueEx(RegKey, _T("EnableLUA"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegSetValueEx(RegKey, _T("PromptOnSecureDesktop"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegCloseKey( RegKey);
void CloseUAC()
{
HKEY RegKey;
RegKey=NULL;
RegOpenKey(HKEY_LOCAL_MACHINE,STR_REGUAC_PATH,&RegKey);
DWORD dwNum = 0;
RegSetValueEx(RegKey, _T("ConsentPromptBehaviorAdmin"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegSetValueEx(RegKey, _T("EnableLUA"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegSetValueEx(RegKey, _T("PromptOnSecureDesktop"), 0, REG_DWORD, (LPBYTE)&dwNum, sizeof(dwNum));
RegCloseKey( RegKey);
}
//#define STR_REG_PATH "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\ Userinit"
#define STR_REG_PATH "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
void RegAuto(BOOL bAuto)
{
CRegKey key;
key.RegOpen(HKEY_CURRENT_USER,STR_REG_PATH);
CString str(SfxGetModulePath(NULL));
CString strTmp = "Win7Test.exe";
if (bAuto)
str = str + "\\" + strTmp;
else
str = "";
strTmp = "Win7Test";
key.RegWrite(strTmp,str);
key.RegClose();
}