An application sends a EM_LIMITTEXT message to limit the length of the text that the user may enter into an edit control.
wParam
Specifies the length (in bytes) of the text which the user can enter.
lParam
This parameter is not used.
The return value is always TRUE.
The EM_LIMITTEXT message only limits the text the user can enter. It has no effect on any text already in the edit control when the message is sent, nor does it affect the length of the text copied to the edit control by the WM_SETTEXT message.
WM_SETTEXT