How to detect UAC

How can I detect if UAC is enabled or disabled?
DSOMAsked:
Who is Participating?
 
Eddie ShipmanConnect With a Mentor All-around developerCommented:
You can also check this registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA

0=Disabled
1=Enabled
0
 
xtreminatorDIYerCommented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.