Win32问题:SendMessage(hwnd, EM_LIMITTEXT, 32000, OL) ;

villager 2003-08-23 02:01:46
EM_LIMITTEXT

这是什么意思???有没有SendMessage()第二个参数的详细文档?最好是中文的谢谢。英语的也可以
...全文
255 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Vobo 2003-08-23
  • 打赏
  • 举报
回复
The EM_LIMITTEXT message sets the text limit of an edit control. The text limit is the maximum amount of text, in TCHARs, that the user can type into the edit control. You can send this message to either an edit control or a rich edit control.只有第一句有用!!呵呵~~
James0001 2003-08-23
  • 打赏
  • 举报
回复
设置 文本框 最多能包含的字符的个数。
Vobo 2003-08-23
  • 打赏
  • 举报
回复
The EM_LIMITTEXT message sets the text limit of an edit control. The text limit is the maximum amount of text, in TCHARs, that the user can type into the edit control. You can send this message to either an edit control or a rich edit control.

For edit controls and Microsoft Rich Edit 1.0, bytes are used. For Rich Edit 2.0 and later, characters are used.

Syntax

To send this message, call the SendMessage function as follows.


lResult = SendMessage(
// returns LRESULT in lResult
(HWND) hWndControl,
// handle to destination control
(UINT) EM_LIMITTEXT,
// message ID
(WPARAM) wParam,
// = (WPARAM) () wParam;
(LPARAM) lParam
// = 0; not used, must be zero
);


Parameters

wParam
Specifies 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 Value

This message does not return a value.

Remarks

The EM_LIMITTEXT message limits only the text the user can enter. It does not affect 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. 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.

Before EM_LIMITTEXT 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.

Edit controls on Windows 95/98/Me: 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.

Rich Edit: Supported in Rich Edit 1.0 and later. Use the message EM_EXLIMITTEXT for text length values greater than 64,000. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.


这下你满意了吧!!哇哈哈哈哈~~

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧