﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1593	Prevent script Exit from OnAutoItExitRegister function	MrCreatoR <mscreator@…>		"It would be usefull if we could prevent the exit from script inside the function that called by OnAutoItExitRegister.

Example:


{{{
#include <GUIConstantsEx.au3>

OnAutoItExitRegister(""_Exit"")

$hGUI = GUICreate(""Test Script"", 300, 200)
GUISetState(@SW_SHOW, $hGUI)

While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			Exit
	EndSwitch
WEnd

Func _Exit()
	Local $iAsk = MsgBox(51, 'Question', 'Save changes?' & @LF & @LF & 'Press [Cancel] button to prevent program Exit.', 0, $hGUI)
	
	Switch $iAsk
		Case 2 ;[Cancel] pressed
			Return 1 ;This should prevent the exit and return to the line where the Exit function was called (line #11)
		Case 6 ;[OK] pressed
			;_SaveSettings()
	EndSwitch
EndFunc
}}}

The function calling order is from last to the first if i am not wrong, so there should not be a problem with UDFs that might use OnAutoItExitRegister."	Feature Request	closed		AutoIt		None	Rejected	OnAutoItExitRegister, exit, prevent	
