UAC enable information is stored in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
subkey.
In this sub key values, EnableLUA key value present windows enabled UAC or not.
So we can make a simple code that checking a current windows UAC status.
BOOL IsUacOn()
{
DWORD res = ERROR_SUCCESS;
DWORD dwType = REG_DWORD;
DWORD UacOnOff = 0;
DWORD sz = sizeof(DWORD);
res = SHGetValue(HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"),
_T("EnableLUA"), &dwType, &UacOnOff, &sz);
if(res == ERROR_SUCCESS)
{
if(UacOnOff == 1)
return TRUE;
else
return FALSE;
}
else
return FALSE;
}
Saturday, November 21, 2009
How to check UAC On/Off
Subscribe to:
Posts (Atom)