Glyph Posted August 16, 2008 Share Posted August 16, 2008 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 Link to comment Share on other sites More sharing options...
oMBRa Posted August 16, 2008 Share Posted August 16, 2008 the X of the message box or of the GUI? Link to comment Share on other sites More sharing options...
Developers Jos Posted August 16, 2008 Developers Share Posted August 16, 2008 (edited) This is not the right place to test for that. You test this with the Event of GetMsg(). If $msg = $GUI_EVENT_CLOSE Then Edited August 16, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Glyph Posted August 16, 2008 Author Share Posted August 16, 2008 This is not the right place to test for that. You test this with the Event of GetMsg(). If $msg = $GUI_EVENT_CLOSE Thenwoops, 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now