EM_LIMITTEXT

2.x

EM_LIMITTEXT
wParam = (WPARAM) cchMax;   /* text length            */
lParam = 0L;                /* not used, must be zero */

An application sends an EM_LIMITTEXT message to limit the length of the text the user can enter into an edit control.

Parameters

cchMax

Value of wParam. Specifies the length, in bytes, of the text the user can enter. If this parameter is zero, the text length is set to 65,535 bytes.

Return Value

This message does not return a value.

Comments

The EM_LIMITTEXT message limits only 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 text copied to the edit control by the WM_SETTEXT message.

If an application uses the WM_SETTEXT message to place more text into an edit control than is specified in the EM_LIMITTEXT message, the user can edit the entire contents of the edit control.

See Also

WM_SETTEXT