载入中
自定义HTML载入中... loading
EM_SETSEL 消息 [翻译 2008-03-24 01:15:11]  删除... 
字体变小 字体变大

Selects a range of characters in an edit control. You can send this message to either an edit control or a rich edit control.

在一个edit控件中选择一定范围的字符。你既可以将这个消息发送到edit控件也可以发送到rich edit控件。

Syntax

语法

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

要发送此消息,以如下格式调用SendMessage函数: 

lResult = SendMessage(     // returns LRESULT in lResult
   (HWND) hWndControl,     // handle to destination control
   (UINT) EM_SETSEL,     // message ID
   (WPARAM) wParam,     // = (WPARAM) () wParam;
   (LPARAM) lParam     // = (LPARAM) () lParam;
);

Parameters

参数

wParam
The starting character position of the selection.
选择字符的开始位置 
lParam
The ending character position of the selection.
选择字符的结束位置 

Return Value

返回值

This message does not return a value.

这个消息不返回任何值。 

Remarks

备注

The start value can be greater than the end value. The lower of the two values specifies the character position of the first character in the selection. The higher value specifies the position of the first character beyond the selection.

The start value is the anchor point of the selection, and the end value is the active end. If the user uses the SHIFT key to adjust the size of the selection, the active end can move but the anchor point remains the same.

If the start is 0 and the end is –1, all the text in the edit control is selected. If the start is –1, any current selection is deselected.

Edit controls: The control displays a flashing caret at the end position regardless of the relative values of start and end.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.

Message Information

Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
分类: 编程基础
票数:
什么是“我顶”?
点击数:    评论数:
本文章引用通告地址(TrackBack Ping URL)为:
本文章尚未被引用。
发表评论
大 名:
(不填写则显示为匿名者)
网 址:
(您的网址,可以不填)
标 题:
内 容:
请根据下图中的字符输入验证码:
(您的评论将有可能审核后才能发表)
和讯个人门户 v1.0 | 和讯部落 | 客服中心