#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hGui = GUICreate('Edit', 200, 200)
$idEdit = GUICtrlCreateEdit('', 20, 40, 160, 120)
GUICtrlCreateLabel('Кол-во символов в Edit:', 20, 5, 130, 20)
$idLbl = GUICtrlCreateLabel(StringLen(GUICtrlRead($idEdit)), 150, 5, 30, 20)
$idDummy = GUICtrlCreateDummy()
GUIRegisterMsg($WM_COMMAND, '_WM_COMMAND')
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $idDummy
GUICtrlSetData($idLbl, StringLen(GUICtrlRead($idEdit)))
EndSwitch
WEnd
Func _WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $iIDFrom, $iCode
$iIDFrom = BitAND($iwParam, 0xFFFF) ; _WinAPI_LoWord
$iCode = BitShift($iwParam, 16) ; _WinAPI_HiWord
Switch $hWnd
Case $hGui
Switch $iIDFrom
Case $idEdit
Switch $iCode
Case $EN_CHANGE
GUICtrlSendToDummy($idDummy)
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND