#include #include #Include Global $g_hGUI1, $g_idButton1, $g_idButton2, $g_hGUI2, $g_idButton3 example() Func example() gui1() _Skin_EnableFocus(1) Local $aMsg While 1 _Skin_Helper($g_hGUI1) _Skin_Helper($g_hGUI2) $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array If Not IsHWnd($aMsg[1]) Then ContinueLoop ; preventing subsequent lines from processing when nothing happens Switch $aMsg[1] ; check which GUI sent the message Case $g_hGUI1 Switch $aMsg[0] ; Now check for the messages for $g_hGUI1 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI: $g_hGUI1 ... ExitLoop ; ... exit the loop and thus exit the program Case $g_idButton1 MsgBox($MB_OK, "MsgBox 1", "Test from GUI 1") Case $Button ;GUICtrlSetState($g_idButton2, $GUI_DISABLE) gui2() EndSwitch Case $g_hGUI2 Switch $aMsg[0] ; Now check for the messages for $g_hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI : $g_hGUI2 ... GUIDelete($g_hGUI2) ; ... just delete the GUI ... ;GUICtrlSetState($g_idButton2, $GUI_ENABLE) ; ... enable button (previously disabled) Case $g_idButton3 MsgBox($MB_OK, "MsgBox", "Test from GUI 2") EndSwitch EndSwitch WEnd EndFunc ;==>example Func gui1() $g_hGUI1 = GUICreate("GUI 1", 200, 200, 100, 100) $g_idButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30) $g_idButton2 = GUICtrlCreateButton("Show GUI 2", 10, 60, 80, 30) Global $Button = _Skin_AddButton(20,110,64,64,'red_normal.png', 'red_hover.png', 'red_click.png','','',1) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR + $GUI_DOCKHEIGHT) GUISetState() EndFunc ;==>gui1 Func gui2() $g_hGUI2 = GUICreate("GUI 2", 200, 200, 350, 350) GUISetState() Global $g_idButton3 = _Skin_AddButton(10,10,80,30,'yellow_normal.png', 'yellow_hover.png', 'yellow_click.png','','',1) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKSTATEBAR + $GUI_DOCKHEIGHT) EndFunc ;==>gui2