EM_LINEFROMCHAR

2.x

EM_LINEFROMCHAR
wParam = (WPARAM) ich;    /* character index        */
lParam = 0L;              /* not used, must be zero */

An application sends an EM_LINEFROMCHAR message to retrieve the line number of the line that contains the specified character index. A character index is the number of characters from the beginning of the edit control.

This message is processed only by multiline edit controls.

Parameters

ich

Value of wParam. Specifies the character index of the character contained in the line whose number is to be retrieved. If the ich parameter is –1, either the line number of the current line (the line containing the caret) is retrieved or, if there is a selection, the line number of the line containing the beginning of the selection is retrieved.

Return Value

The return value is the zero-based line number of the line containing the character index specified by ich.

Example

This example sends an EM_LINEFROMCHAR message to retrieve the line number of the current line in a multiline edit control:

SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
    EM_LINEFROMCHAR, -1, 0L);

See Also

EM_LINEINDEX