EM_FILELINELENGTH message

Retrieves the length, in characters, of a line in an edit control, independently of how lines are displayed on the screen.

Parameters

wParam

The character index of a character in the line whose length is to be retrieved. If this parameter is greater than the number of characters in the control, the return value is zero.

This parameter can be -1. In this case, 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).

lParam

This parameter is not used.

Return value

For multiline edit controls, the return value is the length, in TCHARs, of the line specified by the wParam parameter, independently of how lines are displayed on the screen. It does not include the carriage-return or linefeed character at the end of the line.

For single-line edit controls, the return value is the length, in TCHARs, of the text in the edit control.

If wParam is greater than the number of characters in the control, the return value is zero.

Remarks

Use the EM_FILELINEINDEX message to retrieve a character index for a given line number within a multiline edit control, independently of how lines are displayed on the screen.

Requirements

Requirement Value
Minimum supported client
Windows 10, 1809 [desktop apps only]
Minimum supported server
Windows Server 2019 [desktop apps only]
Header
CommCtrl.h

See also

EM_FILELINEINDEX