EM_GETTEXTEX Message
The EM_GETTEXTEX message allows you to get all of the text from the rich edit control in any particular code base you want.
Syntax
To send this message, call the
SendMessage
function as follows.
lResult = SendMessage(
| // returns LRESULT in lResult
|
(HWND) hWndControl,
| // handle to destination control
|
(UINT) EM_GETTEXTEX,
| // message ID
|
(WPARAM) wParam,
| // = (WPARAM) () wParam; |
(LPARAM) lParam
| // = (LPARAM) () lParam; |
);
| |
Parameters
- wParam
-
Pointer to a GETTEXTEX structure, which indicates how to translate the text before putting it into the output buffer.
- lParam
-
Pointer to a null-terminated string that receives the text. The size of this buffer should be placed in the cb member of the GETTEXTEX structure.
Return Value
The return value is the number of TCHARs copied into the output buffer.
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 null terminator 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.
Message Information
Header | Declared in Richedit.h |
---|
Minimum operating systems |
Windows 95 with Rich Edit 2.0
, Windows
98, Windows NT
4.0 |
---|
See Also
Rich Edit Controls, EM_SETTEXTEX, GETTEXTEX, WideCharToMultiByte, WM_SETTEXT