The EM_GETSELTEXT message retrieves the currently selected text in a rich edit control.
EM_GETSELTEXT wParam = 0; lParam = (LPARAM) (LPSTR) lpBuf;
Returns the number of characters copied, not including the terminating null character.
See: