lolp1 Posted June 10, 2007 Posted June 10, 2007 Hello, I was not sure, how I could do something before a users attempts to close a program. For example if they tried to close the program, MsgBox("64","test","Do you really want to exit the program?") Any help is appreciated.
Valuater Posted June 10, 2007 Posted June 10, 2007 #include <GUIConstants.au3> Opt("OnExitFunc", "endscript") GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func endscript() MsgBox(0,"","after last statement " & @EXITMETHOD) EndFunc 8)
Moderators SmOke_N Posted June 10, 2007 Moderators Posted June 10, 2007 (edited) @lop... Quite a "novice" question for someone that has been here so long? #include <GUIConstants.au3> Opt("OnExitFunc", "endscript") GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func endscript() MsgBox(0,"","after last statement " & @EXITMETHOD) EndFunc? Edit: Had to fix to whom I was talking to/about there. Edited June 10, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
lolp1 Posted June 10, 2007 Author Posted June 10, 2007 @lop... Quite a "novice" question for someone that has been here so long? OrFunc OnAutoItExit() ;Etc EndFunc? Edit: Had to fix to whom I was talking to/about there. Well I've never had to do this, and I looked all over the help files and searched it, and could not find any information. How did you expect me to figure it out, magic?
Moderators SmOke_N Posted June 11, 2007 Moderators Posted June 11, 2007 Well I've never had to do this, and I looked all over the help files and searched it, and could not find any information. How did you expect me to figure it out, magic?No... Common sense would have worked for me ... You know, Autoit's help file "search" option or even ... the forums search option(s). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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