#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <WinAPIEx.au3>
$hForm = GUICreate("", 550, 300)
GetCtrlID()
GUICtrlCreateButton("Hello", 20, 20, 80, 20)
GUICtrlCreateButton("Hello", 20, 50, 80, 20)
GUICtrlCreateButton("Hello", 20, 80, 80, 20)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func GetCtrlID()
GUIRegisterMsg(0x000F, "WM_PAINT")
EndFunc
Func WM_PAINT($hWnd, $iMsg, $wParam, $lParam)
If WinExists($hWnd) Then
Local $iCtrlID = _WinAPI_EnumChildWindows($hWnd, 1)
For $i = 1 To UBound($iCtrlID) - 1
ControlSetText($hWnd, "", _WinAPI_GetDlgCtrlID($iCtrlID[$i][0]), "Button " & $i)
Next
EndIf
Return 'GUI_RUNDEFMSG'
EndFunc