HowTo programmatically detect if UAC is enabled or disabled?

HowTo programmatically detect if UAC is enabled or disabled?

Post by Nick River » Tue, 13 Feb 2007 22:54:28


Hi!

I need to know programmatically exactly if UAC is enabled or disabled.

Thanks
-Nick
 
 
 

HowTo programmatically detect if UAC is enabled or disabled?

Post by SmVzcGV » Wed, 14 Feb 2007 01:48:01

I am unable to find an API to do this. However, checking the value of this
key works:
Hive: HKLM
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Value: EnableLUA
Type: REG_DWORD
Data: 1 (Default, enabled)
0 (Disabled)