CheckElevationEnabled

Go to Home Page

Returns whether UAC is enabled

Syntax

DWORD WINAPI CheckElevationEnabled (
    BOOL* pResult
)

Parameters

pResult
On output, nonzero if UAC is enabled zero otherwise. Cannot be NULL

Return Value

An ERROR_ status defined in winerror.h

Remarks

Calls RtlQueryElevationFlags and checks whether the UAC bit flag is set.

This method of checking whether UAC is enabled is more reliable than checking the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA registry key

See here for more in depth information on this function.