EM_STREAMOUT

The EM_STREAMOUT message causes a rich edit control to pass its contents to an application-defined EditStreamCallback callback function. The callback function can then write the stream of data to a file or any other location that it chooses.

EM_STREAMOUT 
wParam = (WPARAM) (UINT) uFormat; 
lParam = (LPARAM) (EDITSTREAM FAR *) lpStream; 
 

Parameters

uFormat
Value specifying one of the following data formats:
Value Meaning
SF_TEXT Text with spaces in place of OLE objects
SF_RTF Rich Text Format (RTF)
SF_RTFNOOBJS RTF with spaces in place of OLE object.
SF_TEXTIZED Text with a text representation of OLE objects.

The SF_RTFNOOBJS option is useful if an application stores OLE objects itself, as RTF representation of OLE objects is not very compact. The control word "\objattph" followed by a space denotes the object position.

You can combine any of the data format values with the SFF_SELECTION flag. If you specify SFF_SELECTION, the rich edit control streams out only the contents of the current selection. Otherwise, the control streams out its entire contents.

You can combine the SF_RTF and SF_RTFNOOBJS values with the SFF_PLAINRTF flag. If you specify SFF_PLAINRTF, the rich edit control streams out only keywords common to all languages; it ignores language-specific RTF keywords.

lpStream
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 Values

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.

QuickInfo

  Windows NT: Requires version 3.51 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in richedit.h.

See Also

Rich Edit Controls Overview, Rich Edit Messages, EDITSTREAM, EditStreamCallback, EM_STREAMIN