EM_GETTEXTLENGTHEX message

Calculates text length in various ways. It is usually called before creating a buffer to receive the text from the control.

Parameters

wParam

Pointer to a GETTEXTLENGTHEX structure that receives the text length information.

lParam

This parameter is not used; it must be zero.

Return value

The message returns the number of TCHARs in the edit control, depending on the setting of the flags in the GETTEXTLENGTHEX structure. If incompatible flags were set in the flags member, the message returns E_INVALIDARG .

Remarks

This message is a fast and easy way to determine the number of characters in the Unicode version of the rich edit control. However, for a non-Unicode target code page you will potentially be converting to a combination of single-byte and double-byte characters.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Richedit.h

See also

GETTEXTLENGTHEX