Вот, пример:
Код:
#include <String.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hGui = GUICreate("Form", 320, 40, 192, 185)
$Input = GUICtrlCreateInput("", 8, 8, 249, 21,$ES_UPPERCASE)
$Ok_Button = GUICtrlCreateButton("Ok", 264, 7, 49, 23)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Ok_Button
$R=GUICtrlRead($Input)
GUIDelete($hGui)
MsgBox(0,"Результат",$R)
Exit
EndSelect
WEnd
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Switch $iIDFrom
Case $Input
Switch $iCode
Case $EN_CHANGE
$a=GUICtrlRead($Input)
if StringIsDigit(StringRegExpReplace($a,"(.).*","\1")) then
$a1=StringRegExpReplace($a,Chr(160),"")
GUICtrlSetData($input,_StringAddThousandsSep($a1))
else
$c=StringRegExpReplace($a,"(.*)(.)","$1$2$2$2")
GUICtrlSetData($input,$c)
endif
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND