The EM_EXGETSEL message retrieves the starting and ending character positions of the selection in a rich edit control.
EM_EXGETSEL wParam = 0; lParam = (LPARAM) (CHARRANGE FAR *) lpchr;
No return value.
CHARRANGE