The EM_EXLINEFROMCHAR message determines which line contains the specified character in a rich edit control.
EM_EXLINEFROMCHAR wParam = 0; lParam = (LPARAM) (DWORD) ichCharPos;
Returns the zero-based index of the line.