Real Geek Forums  

Go Back   Real Geek Forums > Archives > Operating Systems > Windows Vista > Windows Vista Administration

Notices

Reply

Programmatically "elevate" my app for a particular task.

 

LinkBack Thread Tools Display Modes
Old 11-07-2007, 11:14 AM   #1 (permalink)
Default 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.


Ricardo Vazquez
Guest
 
Posts: n/a
Reply With Quote  
Old 11-07-2007, 12:42 PM   #2 (permalink)
Default Re: Programmatically "elevate" my app for a particular task.

Ricardo Vazquez schrieb:
Quote:
> 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
Robert Kochem
Guest
 
Posts: n/a
Reply With Quote  
Reply

Tags
None

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may 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


Similar Threads

Thread Thread Starter Forum Replies Last Post
How can I add the icons "Delete", "Cut", "Copy" and "Paste" in Vis Moonwalker Windows Vista File Management 5 09-17-2007 10:53 PM
Programmatically configure TCPIP settings "Alternate Configuration" Arnie Windows XP WMI 3 08-31-2005 05:35 PM
TD Error: 1004: Invalid resource: "<File(819):"%17%","machine.inf">": Juergen Striegel Windows XP Embedded 2 11-28-2003 11:20 AM
Can I programmatically change "Group similar taskbar buttons"? Chad C. Mulligan Customize Windows XP 1 09-16-2003 11:58 PM
block "new task" on task manager ab Windows XP Security & Administration 1 07-01-2003 01:24 AM


All times are GMT. The time now is 12:01 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright © 2005 - 2007 RealGeek.com. All rights reserved.

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