Registers a function to be called when AutoIt exits.
OnAutoItExitRegister ( "function" )
function | The name of the user function to call. |
Success: | 1. @extended can be set if already registered. |
Failure: | 0. |
The exit code can be retrieved with @exitCode.
The mode of exit can be retrieved with @exitMethod.
$EXITCLOSE_NORMAL (0) | Natural closing. |
$EXITCLOSE_BYEXIT (1) | close by Exit function. |
$EXITCLOSE_BYCLICK (2) | close by clicking on exit of the systray. |
$EXITCLOSE_BYLOGOFF (3) | close by user logoff. |
$EXITCLOSE_BYSHUTDOWN (4) | close by Windows shutdown. |
Exit, OnAutoItExitUnRegister, OnAutoItStartRegister, SetExitCode (Option), _FormatAutoItExitCode, _FormatAutoItExitMethod
#include <MsgBoxConstants.au3>
OnAutoItExitRegister("MyTestFunc")
OnAutoItExitRegister("MyTestFunc2")
Sleep(1000)
Func MyTestFunc()
MsgBox($MB_SYSTEMMODAL, "Exit Results 1", 'Exit Message from MyTestFunc()')
EndFunc ;==>MyTestFunc
Func MyTestFunc2()
MsgBox($MB_SYSTEMMODAL, "Exit Results 2", 'Exit Message from MyTestFunc()')
EndFunc ;==>MyTestFunc2