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.
This message has no parameters.
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.
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);