#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUIStartGroup()
$Button1 = GUICtrlCreateButton("Button1", 216, 112, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 288, 112, 75, 25)
$Button3 = GUICtrlCreateButton("Button3", 216, 136, 75, 25)
$Button4 = GUICtrlCreateButton("Button4", 288, 136, 75, 25)
$Button5 = GUICtrlCreateButton("Button5", 216, 160, 75, 25)
$Button6 = GUICtrlCreateButton("Button6", 288, 160, 75, 25)
GUIStartGroup()
GUISetState(@SW_SHOW)
Local $hWnd = WinWait("[CLASS:AutoIt v3 GUI]", "", 10)
$test = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button1))
$test2 = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button2))
$test3 = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button3))
$test4 = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button4))
$test5 = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button5))
$test6 = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($button6))
ControlClick($hWnd, "", $test)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button1
MsgBox(262144, "test", "Готово: " & "Вы велиполепны")
ControlClick($hWnd, "", $test2)
Case $button2
MsgBox(262144, "test", "Готово: " & "Все еще неплохо")
EndSwitch
WEnd