![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
|
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
|
| 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! |