Jump to content

Recommended Posts

Posted

Func OnAutoItExit()
    $verify=MsgBox(4,"Application","Are you sure you want to exit?")
    if $verify = 6 then Exit
    ;if $verify = 7 then ;cancel exit?
EndFunc   ;==>OnAutoItExit

After the person presses the "x" button I want it to ask before exiting.

If they say no to exit, then I want it to keep the application running.

Is this possible?

tolle indicium

Posted

This is not the right place to test for that.

You test this with the Event of GetMsg().

If $msg = $GUI_EVENT_CLOSE Then
woops, ahhaha!

thanks, heres what worked:

Case $msg = $GUI_EVENT_CLOSE
$verify = msgbox(4,"app","wanna exit?")
 if $verify = 6 then
exit
else
;do nothing
endif

tolle indicium

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...