EM_SETLIMITTEXT

An application sends the EM_SETLIMITTEXT message 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. Remember that in the ANSI character set, each character is one byte, and in the Unicode character set, each character is two bytes.

EM_SETLIMITTEXT 
wParam = (WPARAM) cchMax;    // new text limits, in characters 
lParam = 0;                  // not used, must be zero 
 

Parameters

cchMax
Value of wParam. 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

This message does not return a value.

Remarks

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.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.

See Also

Edit Controls Overview, Edit Control Messages, EM_GETLIMITTEXT