#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Dim $Button[6]
$Form1 = GUICreate("Form1", 462, 97, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_CLOSE")
$Button[1] = GUICtrlCreateButton("Button1", 16, 8, 75, 25)
GUICtrlSetOnEvent(-1, "GUI_Button")
$Button[2] = GUICtrlCreateButton("Button2", 104, 8, 75, 25)
GUICtrlSetOnEvent(-1, "GUI_Button")
$Button[3] = GUICtrlCreateButton("Button3", 192, 8, 75, 25)
GUICtrlSetOnEvent(-1, "GUI_Button")
$Button[4] = GUICtrlCreateButton("Button4", 280, 8, 75, 25)
GUICtrlSetOnEvent(-1, "GUI_Button")
$Button[5] = GUICtrlCreateButton("Button5", 368, 8, 75, 25)
GUICtrlSetOnEvent(-1, "GUI_Button")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(10)
WEnd
Func GUI_CLOSE()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
EndFunc
Func GUI_Button()
Switch @GUI_CtrlId
Case $Button[1]
MsgBox(0,0,GUICtrlRead($Button[1]))
Case $Button[2]
MsgBox(0,0,GUICtrlRead($Button[2]))
Case $Button[3]
MsgBox(0,0,GUICtrlRead($Button[3]))
Case $Button[4]
MsgBox(0,0,GUICtrlRead($Button[4]))
Case $Button[5]
MsgBox(0,0,GUICtrlRead($Button[5]))
EndSwitch
EndFunc