2 out of 5 rated this helpful - Rate this topic

EM_SETSEL message

Applies to: desktop apps only

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

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.

If the edit control has the ES_NOHIDESEL style, the selected text is highlighted regardless of whether the control has focus. Without the ES_NOHIDESEL style, the selected text is highlighted only when the edit control has the focus.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
EM_GETSEL
EM_REPLACESEL
EM_SCROLLCARET
EM_EXSETSEL

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
For define message EM_SETSEL
You must declare EM_SETSEL = 0x00B1
For define message EM_SETSEL
EM_SETSEL = 0x00B1