Windows Vista Forums
Vista Forums Home Join Vista Forums Tech Publications Windows 7 Forum Vista Tutorials Webcasts Tags

Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista security

Program requesting elevation cannot be launched through a button..

Update your Vista Drivers
Reply
 
Thread Tools Display Modes
Old 08-23-2007   #1 (permalink)
mchrist152
Guest


 

Program requesting elevation cannot be launched through a button..

....with UAC on. I have an application that requests elevation through its
manifest. When launched normally, the UAC dialog shows and accepting the
dialog allows the app to run normally. But when I assign this app to a
scanner button using Scanner&Camera in the control panel, the app does not
start when the button is pressed. It doesn't even show the elevation dialog.
If I turn off UAC the button launches the app just as one would expect. If
I create a little launcher app that does not request any elevation, whose
only purpose is to launch the previously mentioned app requesting elevation,
the app launches and runs normally after displaying the UAC dialog. Does
anybody know why a scanner button cannot launch an application that is
requesting elevation if UAC is on? Any help would be greatly appreciated.

My System SpecsSystem Spec
Old 08-24-2007   #2 (permalink)
Adrian Accinelli
Guest


 

Re: Program requesting elevation cannot be launched through a button..


"mchrist152" <mchrist152@discussions.microsoft.com> wrote in message
news:E31A1392-EA0B-4B3B-83BF-3800F64BE1F2@microsoft.com...
> ...with UAC on. I have an application that requests elevation through its
> manifest. When launched normally, the UAC dialog shows and accepting the
> dialog allows the app to run normally. But when I assign this app to a
> scanner button using Scanner&Camera in the control panel, the app does not
> start when the button is pressed. It doesn't even show the elevation
> dialog.
> If I turn off UAC the button launches the app just as one would expect.
> If
> I create a little launcher app that does not request any elevation, whose
> only purpose is to launch the previously mentioned app requesting
> elevation,
> the app launches and runs normally after displaying the UAC dialog. Does
> anybody know why a scanner button cannot launch an application that is
> requesting elevation if UAC is on? Any help would be greatly appreciated.


The backend code is trying to use CreateProcess instead of ShellExecute to
launch the app. This is described in various places on the net but this
link contains information on it:
http://msdn2.microsoft.com/en-us/library/aa905330.aspx

There's a nice description of how ShellExecute works and you'll see
CreateProcess is called and fails and doing so then calls into the
Application Information Service to perform the launch/prompt. With UAC
turned off CreateProcess will succeed so that's why it works in this
situation.

You should mark your app asInvoker and if you detect you need privileges
restart yourself using ShellExecute/Runas so that you will become elevated.

Sincerely,
Adrian Accinelli


My System SpecsSystem Spec
Reply
Update your Vista Drivers

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Box requesting user name & password spandl Vista mail 4 05-23-2008 05:04 PM
Can't Install Due to Elevation (Requires Elevation) Alx Vista installation & setup 3 05-20-2008 04:34 PM
Elevation of Program Rights under Local User Account Corey Vista installation & setup 0 01-09-2008 04:41 PM
Program button on Start Menu Gone Lythria Vista General 5 06-10-2007 11:09 PM
Requesting 64-bit CD rhenson Vista installation & setup 2 01-30-2007 03:39 PM


Complimentary Industry Resources

Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today!




Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

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