#include "GUIInvisible.au3"
#include "GUIConstantsEx.au3"
$gui = GUICreate("Test GUI", 400, 400, -1, -1)
$btn = GUICtrlCreateButton("Drück mich", 100, 100)
GUISetState()

While 1
	$msg = GUIGetMsg()
	Switch $msg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $btn
			GUIInvisible($gui, True, "{Esc}")
			If @error = 1 Then
				MsgBox(0, "Error", "Der angegebene Wert ist kein Boolean!")
			ElseIf @error = 2 Then
				MsgBox(0, "Error", "Der angegebene Wert bezieht sich nicht auf ein GUI!")
			EndIf
	EndSwitch
WEnd
