EM_GETTEXTEX message

Gets the text from a rich edit control.

Parameters

wParam

Pointer to a GETTEXTEX structure, which indicates how to translate the text before putting it into the output buffer.

lParam

Pointer to the buffer to receive the text. The size of this buffer, in bytes, is specified by the cb member of the GETTEXTEX structure. Use the EM_GETTEXTLENGTHEX message to get the required size of the buffer.

Return value

The return value is the number of TCHARs copied into the output buffer, not including the null terminator.

Remarks

If the size of the output buffer is less than the size of the text in the control, the edit control will copy text from its beginning and place it in the buffer until the buffer is full. A terminating null character will still be placed at the end of the buffer.

If ANSI text is requested, EM_GETTEXTEX uses the WideCharToMultiByte function to translate the Unicode characters to ANSI. It allows you to go from Unicode to ANSI using a particular code page. The GETTEXTEX structure contains members (lpDefaultChar and lpUsedDefChar) that are used in the translation from Unicode to ANSI.

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

Reference

EM_SETTEXTEX

GETTEXTEX

Other Resources

WideCharToMultiByte

WM_SETTEXT