Wingens,
Something like this perhaps?
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
Global $iChar_Limit = 5, $aInput[5]
$hGUI = GUICreate("Input Autofocus", 500, 500)
; ######################
; It is important that these controls are created in immediate succession
For $i = 0 To UBound($aInput) - 1
$aInput[$i] = GUICtrlCreateInput("", 20 + (60 * $i), 20, 40, 20)
GUICtrlSetLimit(-1, $iChar_Limit)
If $i Then
GUICtrlSetState(-1, $GUI_DISABLE)
EndIf
Next
$hButton = GUICtrlCreateButton("OK", 75, 60, 80, 30)
GUICtrlSetState(-1, $GUI_DISABLE)
; ######################
For $i = 0 To 3
GUICtrlCreateLabel("-", 70 + (60 * $i), 20, 10, 20)
Next
GUIRegisterMsg($WM_COMMAND, "On_WM_COMMAND")
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $hButton
$sString = ""
For $i = 0 To UBound($aInput) - 1
$sString &= GUICtrlRead($aInput[$i])
Next
MsgBox(0, "Result", $sString)
EndSwitch
WEnd
Func On_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
$iCode = BitShift($wParam, 16)
$iID = BitAND($wParam, 0x0000FFFF)
Switch $iCode
Case $EN_UPDATE ; 0x400 ;
If StringLen(GUICtrlRead($iID)) = $iChar_Limit Then
GUICtrlSetState($iID + 1, $GUI_ENABLE)
GUICtrlSetState($iID + 1, $GUI_FOCUS)
EndIf
EndSwitch
EndFunc ;==>On_WM_COMMAND
Please ask if you have any questions.
M23