The EM_SETTEXTEX message combines the functionality of WM_SETTEXT and EM_REPLACESEL and adds the ability to set text using a code page and to use either rich text or plain text.
Syntax
To send this message, call the
SendMessage
function as follows.
lResult = SendMessage( // returns LRESULT in lResult
hWndControl, // (HWND) handle to destination control
EM_SETTEXTEX, // (UINT) message ID
wParam, // = () wParam;
lParam // = () lParam;
);
Parameters
- wParam
-
Pointer to a SETTEXTEX structure that specifies flags and an optional code page to use in translating to Unicode.
- lParam
-
Pointer to the null-terminated text to insert. This text is an ANSI string, unless the code page is 1200 (Unicode). If lParam starts with a valid Rich Text Format (RTF) ASCII sequence—for example, "{\rtf" or "{urtf"—the text is read in using the RTF reader.
Return Value
If the operation is setting all of the text and succeeds, the return value is 1.
If the operation is setting the selection and succeeds, the return value is the number of bytes or characters copied.
If the operation fails, the return value is zero.
Message Information
| Header | Declared in Richedit.h |
|---|
| Minimum operating systems |
Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000 |
|---|
See Also