#include <GuiConstants.au3>
#include <EditConstants.au3>
Global $i, $iInput1, $iInput2, $iButton1, $iButton2
GUICreate("Пример", 300, 55)
$iInput1 = GUICtrlCreateInput("1 2 3 4 5 6 7 8 9 0", 5, 5, 290, 20)
$iInput2 = GUICtrlCreateInput(0, 5, 30, 145, 20, $ES_NUMBER)
GUICtrlSetState(-1, $GUI_FOCUS)
$iButton1 = GUICtrlCreateUpdown(-1, $UDS_ARROWKEYS)
$iButton2 = GUICtrlCreateButton("Установить позицию", 155, 30, 140, 20)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
GUISetState()
While 1
Switch GUIGetMsg()
Case $iButton1
$i = Number(GUICtrlRead($iInput2))
GUICtrlSetLimit($iButton1, StringLen(GUICtrlRead($iInput1)))
GUICtrlSetState($iInput1, $GUI_FOCUS)
GUICtrlSendMsg($iInput1, $EM_SETSEL, $i, $i)
Case $iButton2
$i = Number(GUICtrlRead($iInput2))
GUICtrlSetLimit($iButton1, StringLen(GUICtrlRead($iInput1)))
GUICtrlSetState($iInput1, $GUI_FOCUS)
GUICtrlSendMsg($iInput1, $EM_SETSEL, $i, $i)
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd