RichEdit_FormatRangefunction
Formats a range of text in a rich edit control for a specific device.
Syntax
FUNCTION RichEdit_FormatRange (BYVAL hRichEdit AS HWND, BYVAL fRender AS LONG, BYVAL lpfr AS FORMATRANGE PTR) AS DWORD
Parameters
| Name | Description | |
|---|---|---|
hRichEdit | The handle of the rich edit control. | |
fRender | Specifies whether to render the text. If this parameter is not zero, the text is rendered. Otherwise, the text is just measured. | |
lpfr | A pointer to a FORMATRANGE structure containing information about the output device, or NULL to free information cached by the control. |
Return value
This message returns the index of the last character that fits in the region, plus 1.
Description
Formats a range of text in a rich edit control for a specific device.
Remarks
This message is typically used to format the content of rich edit control for an output device such as a printer.
After using this message to format a range of text, it is important that you free cached information by sending EM_FORMATRANGE again, but with lParam set to NULL; otherwise, a memory leak will occur. Also, after using this message for one device, you must free cached information before using it again for a different device.
Reference
- Defined in AfxNova/AfxRichEdit.inc:164
- Documented in Windows/WIndows Controls/RichEdit/RichEdit Procedures.md
- Topic: RichEdit Procedures