;~ #AutoIt3Wrapper_AU3Check_Parameters= -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;~ #Tidy_Parameters=/sf #include-once #include #include OnAutoItExitRegister("OnExit") Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 1) Opt("MustDeclareVars", 1) Opt("WinWaitDelay", 0) Global $aMASTER[3] = ["MASTER", 320, 240] Global $aSLAVE[3] = ["SLAVE", 240, 160] Global $sGuiTitle = "GuiTitle" Global $hButton Global $MASTER, $SLAVE MASTER() While Sleep(25) WEnd Func OnExit() GUISetState($MASTER, @SW_HIDE) GUIDelete($MASTER) EndFunc ;==>OnExit Func MASTER() $MASTER = GUICreate($aMASTER[0], $aMASTER[1], $aMASTER[2]) GUISetOnEvent($GUI_EVENT_CLOSE, "MASTER_Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "MASTER_Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "MASTER_Restore") $hButton = GUICtrlCreateButton("SLAVE", 10, 10, 80, 26) GUICtrlSetOnEvent($hButton, "SLAVE") GUISetState(@SW_SHOW, $MASTER) EndFunc ;==>MASTER Func MASTER_Close() ConsoleWrite("MASTER_Close" & @LF) Exit EndFunc ;==>MASTER_Close Func MASTER_Minimize() ConsoleWrite("MASTER_Minimize" & @LF) WinSetState($MASTER, "", @SW_MINIMIZE) EndFunc ;==>MASTER_Minimize Func MASTER_Restore() ConsoleWrite("MASTER_Restore" & @LF) WinSetState($MASTER, "", @SW_RESTORE) EndFunc ;==>MASTER_Restore Func SLAVE() ConsoleWrite("SLAVE" & @LF) GUISetState(@SW_DISABLE, $MASTER) $SLAVE = GUICreate($aSLAVE[0], $aSLAVE[1], $aSLAVE[2], -1, -1, -1, -1, $MASTER) ;~ $SLAVE = GUICreate($aSLAVE[0], $aSLAVE[1], $aSLAVE[2]) GUISetOnEvent($GUI_EVENT_CLOSE, "SLAVE_Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "SLAVE_Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "SLAVE_Restore") GUISwitch($SLAVE) GUISetState(@SW_SHOW, $SLAVE) EndFunc ;==>SLAVE Func SLAVE_Close() ConsoleWrite("SLAVE_Close" & @LF) GUISwitch($MASTER) GUISetState(@SW_ENABLE, $MASTER) GUIDelete($SLAVE) EndFunc ;==>SLAVE_Close Func SLAVE_Minimize() ConsoleWrite("SLAVE_Minimize" & @LF) WinSetState($MASTER, "", @SW_MINIMIZE) WinSetState($SLAVE, "", @SW_MINIMIZE) EndFunc ;==>SLAVE_Minimize Func SLAVE_Restore() ConsoleWrite("SLAVE_Restore" & @LF) WinSetState($MASTER, "", @SW_RESTORE) WinSetState($SLAVE, "", @SW_RESTORE) EndFunc ;==>SLAVE_Restore