#include <GUIConstants.au3> $checking = 0 $Form1 = GUICreate("проверяющая программа", 260, 115, 493, 125) $Button1 = GUICtrlCreateButton("Check", 88, 72, 75, 25, 0) $Label1 = GUICtrlCreateLabel("Нажмите кнопку чтоб начать мониторить", 40, 16, 172, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData ( $Label1, "мониторим соседнее окно..." ) $checking = 1 EndSwitch If $checking = 1 Then If WinExists("уникальный заголовок") Then $Status = ControlCommand ("уникальный заголовок", "", "Search", "IsEnabled" ,"") If $Status = 1 Then GUICtrlSetData ( $Label1, "Кнопка снова активна!" ) MsgBox (0, "Проверка активирована ли к нопка", "Кнопка снова активна!") $checking = 0 EndIf EndIf EndIf WEnd |