#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $iLabel1, $nButtonOK, $nButtonTimer, $iMainGUI _MainGUI() Func _MainGUI() $hParent = GUICreate('', 0, 0, 0, 0, 0, $WS_EX_TOOLWINDOW) $iMainGUI = GUICreate('Main', 300, 105, -1, -1, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST), $hParent) $iLabel1 = GUICtrlCreateLabel('Первый Label', 20, 3, 200, 17) $nButtonOK = GUICtrlCreateButton('ОК', 240, 20, 40, 20) $nButtonTimer = GUICtrlCreateButton('Стоп', 240, 50, 40, 20) GUISetState(@SW_SHOW, $iMainGUI) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $nButtonOK _iError_GUI($iMainGUI) Case $nButtonTimer GUICtrlDelete($iLabel1) ; Удаляем Label. $iLabel1 = GUICtrlCreateLabel('Второй Label.', 20, 3, 200, 17) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func _iError_GUI($Parent = 0) Local $iError_Label, $iError_ButOK $iError_GUI = GUICreate('Error', 240, 80, -1, -1, -1, 0x00000080, $Parent) $iError_Label = GUICtrlCreateLabel('Label другого GUI', 10, 10, 260, 40) $iError_ButOK = GUICtrlCreateButton('OK', 80, 50, 80, 20) GUISetState(@SW_DISABLE, $Parent) GUISetState(@SW_SHOW, $iError_GUI) While 1 $nMsgn = GUIGetMsg() Switch $nMsgn Case $iError_ButOK GUISetState(@SW_ENABLE, $Parent) GUIDelete($iError_GUI) GUISwitch($Parent) ExitLoop Case $GUI_EVENT_CLOSE GUISetState(@SW_ENABLE, $Parent) GUIDelete($iError_GUI) ExitLoop EndSwitch WEnd EndFunc |