#include #include Global $foo If 1 = 2 Then $foo = 1 GUICreate("test", 200, 200) GUISetState() While 1 Global $msg = GUIGetMsg() Switch ($msg) ; Case $gui_event_none Case $GUI_EVENT_CLOSE ExitLoop Case $foo MsgBox($mb_systemmodal, "got here",$msg& " yes " &$foo) EndSwitch WEnd