Results 1 to 3 of 3

Thread: [RESOLVED] ShellExecute - RunAs > Catch 'Cancel'

  1. #1

    Thread Starter
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Resolved [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?

  2. #2
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    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.



  3. #3

    Thread Starter
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: ShellExecute - RunAs > Catch 'Cancel'

    Quote 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
  •  



Click Here to Expand Forum to Full Width