|
-
Dec 2nd, 2008, 12:38 PM
#1
[RESOLVED] ShellExecute - RunAs > Catch 'Cancel'
I've been searching around but I couldn't find any info on this.
If I use ShellExecute with "runas" to elevate a process in Vista, is there a way I can detect if the user clicks "Cancel" instead of "Contnue" button on the UAC prompt?
-
Dec 2nd, 2008, 01:24 PM
#2
Re: ShellExecute - RunAs > Catch 'Cancel'
One way is to check & see if the process is launched?
Or if shellExecute returns a Hwnd (not sure bout this one)
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Dec 2nd, 2008, 01:58 PM
#3
Re: ShellExecute - RunAs > Catch 'Cancel'
 Originally Posted by some1uk03
One way is to check & see if the process is launched?
Or if shellExecute returns a Hwnd (not sure bout this one)
Idea number 2 works. Every time I hit cancel ShellExecute returns '5' and '42' if I click continue.
EDIT: To make things a little clearer for others that might read this, ShellExecute returns a value of 32 or less if there has been an error, and if not returns the handle.
Last edited by baja_yu; Dec 2nd, 2008 at 04:40 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|