FORMATRANGE structure (richedit.h)

Information that a rich edit control uses to format its output for a particular device. This structure is used with the EM_FORMATRANGE message.

Syntax

typedef struct _formatrange {
  HDC       hdc;
  HDC       hdcTarget;
  RECT      rc;
  RECT      rcPage;
  CHARRANGE chrg;
} FORMATRANGE;

Members

hdc

Type: HDC

A HDC for the device to render to, if EM_FORMATRANGE is being used to send the output to a device.

hdcTarget

Type: HDC

An HDC for the target device to format for.

rc

Type: RECT

The area within the rcPage rectangle to render to. Units are measured in twips.

rcPage

Type: RECT

The entire area of a page on the rendering device. Units are measured in twips.

chrg

Type: CHARRANGE

The range of characters to format.

Remarks

hdcTarget contains the HDC to format for, which is usually the same as the HDC specified by hdc but can be different. For example, if you create a print preview module, hdc is the HDC of the window in which the output is viewed, and hdcTarget is the HDC for the printer.

The values for rc and rcPage can be obtained by using GetDeviceCaps.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header richedit.h

See also

EM_FORMATRANGE