Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Programmatically "elevate" my app for a particular task.

microsoft.public.windows.vista.administration accounts passwords






Speedup My PC
Reply
  #1 (permalink)  
Old 11-07-2007
Ricardo Vazquez
 

Posts: n/a
Programmatically "elevate" my app for a particular task.
Hi there!

I developed a MFC/VC++ 6.0 program that has to run at startup.
It monitors some Services which I also developed, giving the user
information on how they are running, and letting him or her start/stop this
Services.
The problem is that to start/stop a service I have to invoke ::OpenService
with SERVICE_START | SERVICE_QUERY_STATUS access: If I run the program as
administrator (elevated), then this works; but if I run it the standard way,
then the function returns "access denied".
I wouldn't mind to check the app so that it would always run as
administrator; but then, when I restart the computer, Windows Defender
"eats" my startup application: no elevated app can be placed at startup.
Windows Defender documentation then suggests to contact the software company
to see if they already have the same app with no need to have elevated
permisions!

A solution for me would be that my app starts as the standard user; BUT when
the person clicks on "stop sevice" UAC prompts him to approve the action!
This is: I would need to be able to programmatically get the UAC promt and
so elevate my app permisions from that moment on.
Is this possible? Which are the API functions I should need?
Can you think of any other solution to my problem?

Thank you very much!!

Cheers,

Ricardo Vazquez.
Madrid, Spain.


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-07-2007
Robert Kochem
 

Posts: n/a
Re: Programmatically "elevate" my app for a particular task.
Ricardo Vazquez schrieb:

> This is: I would need to be able to programmatically get the UAC promt and
> so elevate my app permisions from that moment on.
> Is this possible? Which are the API functions I should need?


May be this article helps you:

"Teach Your Apps To Play Nicely With Windows Vista User Account Control"
http://msdn.microsoft.com/msdnmag/is...lt.aspx?loc=en

Robert
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transcenders app "stops working correctly" when trying to activate MonkeytownGuru microsoft.public.windows.vista.general 1 11-05-2007 22:23
Article ID: 938723 "Hibernates" or "hibernation" appears instead of "sleeps" or "sleep" in Power Options in the Traditional Chinese (CHT) version of Windows Vista KBArticles English 0 10-22-2007 20:00
How can I add the icons "Delete", "Cut", "Copy" and "Paste" in Vis Moonwalker microsoft.public.windows.vista.file management 5 09-17-2007 23:53
App "Stopped Working ... checking for a solution": No I just close Kevin Millican microsoft.public.windows.vista.general 0 05-01-2007 12:49
"Disable Visual Themes" option doesn't work in app properties. Yannek microsoft.public.windows.vista.general 0 04-29-2007 05:22




All times are GMT +1. The time now is 19:01.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120