EM_GETSEL

2.x

EM_GETSEL
wParam = 0;     /* not used, must be zero */
lParam = 0L;    /* not used, must be zero */

An application sends an EM_GETSEL message to get the starting and ending character positions of the current selection in an edit control.

Parameters

This message has no parameters.

Return Value

The return value is a doubleword value that contains the starting position in the low-order word and the position of the first nonselected character after the end of the selection in the high-order word.

Example

This example gets the selection positions of an edit control and converts them into starting and ending positions:

DWORD dwResult;
WORD wStart, wEnd;

dwResult = SendDlgItemMessage(hdlg, ID_MYCOMBOBOX, EM_GETSEL, 0, 0L);
wStart = LOWORD(dwResult);
wEnd   = HIWORD(dwResult);

See Also

EM_SETSEL