Retrieves the length of a line in an edit control.
For single-line edit controls, the return value is the length, in TCHARs, of the text in the edit control.
For multiline edit controls, the return value is the length, in TCHARs, of the line specified by the nLine parameter. For ANSI text, the length is the number of bytes in the line; for Unicode text, the length is the number of characters in the line. The length does not include the carriage-return character at the end of the line.
If the nLine parameter is more than the number of characters in the control, the return value is zero.
If the nLine parameter is –1, the return value is the number of unselected characters in the lines that contain selected characters. For example, if the selection extends from the fourth character of one line through the eighth character from the end of the next line, the return value is 10. That is, three characters on the first line and seven on the next.
For more information about the TCHAR type, see the TCHAR row in the table in Windows Data Types.
This method is supported by the EM_LINELENGTH message, which is described in the Windows SDK.