EM_LINEFROMCHAR

This message returns the line number of the line that contains the character whose position (indexed from the beginning of the text) is specified by the wParam parameter.

Parameter Description  

wParam Contains the index value for the desired character in the text of the edit control (these index values are zero-based), or contains –1.  
lParam Is not used.  

Return Value

The return value is a line number. If wParam is –1, the number of the line that contains the first character of the selection is returned; otherwise, wParam contains the index (or position) of the desired character in the edit-control text, and the number of the line that contains that character is returned.