Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-2008, 07:05 AM
vbigiani vbigiani is offline
Newbie
 
Join Date: Mar 2008
Posts: 4
Rep Power: 0
vbigiani is on a distinguished road
Default How to figure out if UAC is active?

I have a console app that (in certain situations) does not work correctly when UAC is enabled. As such, I'd like to print out a warning (and, if possible, trigger an UAC authorization screen) if UAC is detected as activated. What is the code to do so?

If possible, I'd prefer code in C or C++ for the following functions:
Code:
/* returns 1 if UAC is enabled, 0 if disabled or the OS is a non-Vista  one */
int isUACEnabled()

/* triggers an UAC authorization dialogue, granting full access for the rest of the program's operation. Returns success or failure. */
int AskUAC()
I'm sorry if AskUAC() asks for something incompatible with how Vista works, I'm not any familiar with that.

I tried to search for UAC and "User Account Control", but the first search is disabled and the second didn't return anything relevant.

Many thanks for any answer.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-04-2008, 10:28 PM
TkTech TkTech is offline
 
Join Date: Jun 2006
Posts: 992
Last Blog:
Having trouble with yo...
Rep Power: 20
TkTech is on a distinguished road
Send a message via MSN to TkTech
Default

You need to use the registry to check and see if UAC is enabled. The value is 'EnableLUA' under 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Po licies\System'

If its a '1' then its enabled, else its disabled. If the value doesn't exist, its not running vista.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-05-2008, 03:17 AM
vbigiani vbigiani is offline
Newbie
 
Join Date: Mar 2008
Posts: 4
Rep Power: 0
vbigiani is on a distinguished road
Default

Many thanks for your reply. I'll reply back if I still need help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOw to Master C/C++?How to achieve that ?! Master C and C++ 11 06-21-2007 04:45 PM
where are files created by VIM located? mysticalone Computer Software/OS 6 01-25-2007 08:35 AM
Active Desktop mysticalone Computer Software/OS 5 01-04-2007 08:53 PM


All times are GMT -5. The time now is 06:02 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads