An application sends an EM_GETSEL message to get the starting and ending character positions of the current selection in an edit control.
wParam
This parameter can either be a pointer to a DWORD or NULL. If it is a pointer, Windows fills this DWORD in with the starting position of the selection.
lParam
This parameter can either be a pointer to a DWORD or NULL. If it is a pointer, Windows fills this DWORD in with the ending position of the selection.
The return value is a 32-bit 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.
EM_SETSEL