![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can't Install Due to Elevation (Requires Elevation) | Vista installation & setup | |||
| requesting to be added to my msgr | Live Messenger | |||
| Elevation of Program Rights under Local User Account | Vista installation & setup | |||
| Program button on Start Menu Gone | Vista General | |||
| Requesting 64-bit CD | Vista installation & setup | |||