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_STREAMOUT,
| // message ID
| (WPARAM) wParam,
| // = (WPARAM) () wParam; | (LPARAM) lParam
| // = (LPARAM) () lParam; |
);
| |
Parameters - wParam
-
Specifies the data format and replacement options.
- This value must be one of the following values.
- SF_RTF
- Rich Text Format (RTF).
- SF_RTFNOOBJS
- RTF with spaces in place of Component Object Model (COM) objects.
- SF_TEXT
- Text with spaces in place of COM objects.
- SF_TEXTIZED
- Text with a text representation of COM objects.
- The SF_RTFNOOBJS option is useful if an application stores COM objects itself, as RTF representation of COM objects is not very compact. The control word, \objattph, followed by a space denotes the object position.
In addition, you can specify the following flags. - SFF_PLAINRTF
- If specified, the rich edit control streams out only the keywords common to all languages, ignoring language-specific keywords. If not specified, the rich edit control streams out all keywords. You can combine this flag with the SF_RTF or SF_RTFNOOBJS flag.
- SFF_SELECTION
- If specified, the rich edit control streams out only the contents of the current selection. If not specified, the control streams out the entire contents. You can combine this flag with any of data format values.
- SF_UNICODE
- Microsoft® Rich Edit 2.0 and later: Indicates Unicode text. You can combine this flag with the SF_TEXT flag.
- SF_USECODEPAGE
- Rich Edit 3.0 and later: Generates 8-bit Unicode transformation format (UTF) RTF as well as text using other code pages. The code page is set in the high word of wParam. For example, for UTF-8 RTF, set wParam to (CP_UTF8 << 16) | SF_USECODEPAGE | SF_RTF.
- lParam
-
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application–defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.
Return Value
This message returns the number of characters written to the data stream.
Remarks When you send an EM_STREAMOUT message, the rich edit control makes repeated calls to the EditStreamCallback function specified by the pfnCallback member of the EDITSTREAM structure. Each time it calls the callback function, the control passes a buffer containing a portion of the contents of the control. This process continues until the control has passed all its contents to the callback function, or until an error occurs.
Message Information Header | Declared in Richedit.h |
---|
Minimum operating systems |
Windows
95, Windows NT
4.0 |
---|
See Also Rich Edit Controls, EDITSTREAM, EditStreamCallback, EM_STREAMIN
|