EM_SETLIMITTEXT

This message is sent by an application to set the text limit for an edit control. The text limit is the maximum amount of text, in bytes, that the edit control can contain.

At a Glance

Header file: Winuser.h
Windows CE Versions: 1.0 and later

Syntax

EM_SETLIMITTEXT wParam = (WPARAM) cbMax; lParam = 0;

Parameters

cchMax

Specifies the new text limit, in characters. If this parameter is 0, the system sets the maximum text limit. For more information, see Remarks.

Return Values

None.

Remarks

The Win32 Platform SDK erroneously states that EM_SETLIMITTEXT sets the limit to the number of bytes specified by cbMax. Both Windows NT and Windows CE set the limit to the number of chars specified by the cbMax.

Windows NT

For single-line edit controls, the text limit is either 0x7FFFFFFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either 0xFFFFFFFF bytes or the value of the wParam parameter, whichever is smaller.

Windows 95 and Windows 98

For single-line edit controls, the text limit is either 0x7FFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either 0xFFFF bytes or the value of the wParam parameter, whichever is smaller.

See Also

EM_GETLIMITTEXT