MSDN Home >  MSDN Library >  User Interface Design and Development >  Windows Controls >  Individual Control Information >  Rich Edit Controls > 

EM_FORMATRANGE Message


The EM_FORMATRANGE message formats a range of text in a rich edit control for a specific device.

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_FORMATRANGE,     // message ID
   (WPARAM) wParam,     // = (WPARAM) () wParam;
   (LPARAM) lParam     // = (LPARAM) () lParam;
);

Parameters

wParam
Specifies whether to render the text. If this parameter is a nonzero value, the text is rendered. Otherwise, the text is just measured.
lParam
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 one.


Remarks

This message is typically used with the EM_DISPLAYBAND message to format the content of rich edit control for an output device such as a printer.

It is very important to free cached information after the last time you use this message by specifying NULL in lParam. In addition, after using this message for one device, you must free cached information before using it again for a different device.

Message Information

HeaderDeclared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0

See Also

Rich Edit Controls, EM_DISPLAYBAND, FORMATRANGE
 Contact Us   |  E-Mail this Page   |  MSDN Flash Newsletter
 c 2002 Microsoft Corporation. All rights reserved.   Terms of Use  Privacy Statement   Accessibility