An application sends an EM_SETSEL message to select a range of characters in an edit control.
EM_SETSEL
wParam = (WPARAM) (INT) nStart; // starting position
lParam = (LPARAM) (INT) nEnd; // ending position
This message does not return a value.
In a rich edit control, if the selection is not entirely contained in the first 64K, use the message EM_EXSETSEL.
If the nStart parameter is 0 and the nEnd parameter is –1, all the text in the edit control is selected. If nStart is –1, any current selection is removed. The caret is placed at the end of the selection indicated by the greater of the two values nEnd and nStart.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Edit Controls Overview, Edit Control Messages, EM_GETSEL, EM_REPLACESEL, EM_SCROLLCARET, EM_EXSETSEL