An application sends an EM_LINEFROMCHAR message to retrieve the index of the line that contains the specified character index in a multiline edit control. A character index is the number of characters from the beginning of the edit control.
EM_LINEFROMCHAR wParam = (WPARAM) ich; // character index lParam = 0; // not used; must be zero
The return value is the zero-based line number of the line containing the character index specified by ich.
In a rich edit control, if the character index is greater than 64K, use the message EM_EXLINEFROMCHAR.