EM_LINELENGTH

2.x

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

An application sends an EM_LINELENGTH message to retrieve the length of a line in an edit control.

Parameters

ich

Value of wParam. Specifies the character index of a character in the line whose length is to be retrieved when EM_LINELENGTH is sent to a multiline edit control. If this parameter is –1, the message returns the number of unselected characters on lines containing selected characters. For example, if the selection extended from the fourth character of one line through the eighth character from the end of the next line, the return value would be 10 (three characters on the first line and seven on the next).

When EM_LINELENGTH is sent to a single-line edit control, this parameter is ignored.

Return Value

The return value is the length, in bytes, of the line specified by the ich parameter when an EM_LINELENGTH message is sent to a multiline edit control. The return value is the length, in bytes, of the text in the edit control when an EM_LINELENGTH message is sent to a single-line edit control.

Comments

Use the EM_LINEINDEX message to retrieve a character index for a given line number within a multiline edit control.

See Also

EM_LINEINDEX