To send this message, call the SendMessage function as follows. lResult = SendMessage( (HWND) hWndControl, (UINT) EM_SETLIMITTEXT, (WPARAM) wParam, (LPARAM) lParam // = 0; not used, must be zero ); wParam The maximum number of TCHARs the user can enter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. This number does not include the terminating null character. Rich edit controls: If this parameter is zero, the text length is set to 64,000 characters. Edit controls on Windows NT/2000/XP: If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or –1 for multiline edit controls. Edit controls on Windows 95/98/Me: If this parameter is zero, the text length is set to 0x7FFE characters for single-line edit controls or 0xFFFF for multiline edit controls. lParam This parameter is not used. Return ValueThis message does not return a value.
控件面板上的RichEdit控件
Before EM_SETLIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters. Edit controls on Windows NT/2000/XP: 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 –1 bytes or the value of the wParam parameter, whichever is smaller. 默认是32767,最大为2G,修改默认使用CEdit::SetLimitText()函数
To send this message, call the SendMessage function as follows.
lResult = SendMessage(
(HWND) hWndControl,
(UINT) EM_SETLIMITTEXT,
(WPARAM) wParam,
(LPARAM) lParam // = 0; not used, must be zero
); wParam
The maximum number of TCHARs the user can enter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. This number does not include the terminating null character.
Rich edit controls: If this parameter is zero, the text length is set to 64,000 characters.
Edit controls on Windows NT/2000/XP: If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or –1 for multiline edit controls.
Edit controls on Windows 95/98/Me: If this parameter is zero, the text length is set to 0x7FFE characters for single-line edit controls or 0xFFFF for multiline edit controls. lParam
This parameter is not used.
Return ValueThis message does not return a value.
控件面板上的RichEdit控件
默认是32767,最大为2G,修改默认使用CEdit::SetLimitText()函数