The EM_GETTEXTRANGE message retrieves a specified range of characters from a rich edit control.
EM_GETTEXTRANGE wParam = 0; lParam = (LPARAM) (TEXTRANGE FAR *) lpRange;
Returns the number of characters copied, not including the terminating null character.