###Function###
OnAutoItExitRegister

###Description###
Registers a function to be called when AutoIt exits.

###Syntax###
OnAutoItExitRegister( "function" )


###Parameters###
@@ParamTable@@
function
	The name of the user function to call.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Returns 1. @extended can be set if already registered.
Failure:	Returns 0.
@@End@@


###Remarks###
The exit code can be retrieved with @ExitCode.
The mode of exit can be retrieved with @ExitMethod.
@@ParamTable@@
0
	Natural closing.
1
	close by Exit function.
2
	close by clicking on exit of the systray.
3
	close by user logoff.
4
	close by Windows shutdown.
@@End@@


###Related###
OnAutoItExitUnRegister, Exit


###Example###
@@IncludeExample@@
