Genos, You need the handle, not the ControlID: #include <GUIConstantsEx.au3> #Include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 400, 20) GUICtrlCreateButton("Test", 10, 100, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() Sleep(5000) _WinAPI_SetFocus(ControlGetHandle("Test", "", $hInput)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23