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.
Windows NT: Requires version 3.51 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in richedit.h.
Rich Edit Controls Overview, Rich Edit Messages