• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 961
  • Last Modified:

How to detect UAC

How can I detect if UAC is enabled or disabled?
0
DSOM
Asked:
DSOM
1 Solution
 
xtreminatorCommented:
comman methode to detect UAC in vista is creating new notepad file and write some text and save this file in root drive

eg.

go to c: drive
create new notepad file and write something (dummy) entries and try to save in C: drive, when error prompted like cant save or cant make file that means UAC is enabled.

and every time u prompting when u settings in system (system protection prompt, OS need to answer it)
0
 
DSOMAuthor Commented:
Thanks but my program is elevated so I would be able to create that file without error.  I am looking for an API or some other programming means.
0
 
stOrMCommented:
Hi,
you could use JWSCL for this in the JWSCLToken.pas unit you'll find function JwIsUACEnabled: Boolean;

The JWSCL Api can be downloaded here http://blog.delphi-jedi.net/home/

regards
stOrM!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DSOMAuthor Commented:
Unfortunately that function does not appear in that unit (anymore) :/
0
 
stOrMCommented:
Huh? Maybe you have an outdated version? Maybe you should update via svn in mine there is the function inside!

regards
s!
0
 
Eddie ShipmanAll-around developerCommented:
You can also check this registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA

0=Disabled
1=Enabled
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now