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?
Printable View
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?
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.Quote:
Originally Posted by some1uk03
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.