CPageSetupDialog::OnDrawPage

virtual UINT OnDrawPage( CDC* pDC, UINT nMessage, LPRECT lpRect );

Return Value

Nonzero value if handled; otherwise 0.

Parameters

pDC

Pointer to the printer device context.

nMessage

Specifies a message, indicating the area of the page currently being drawn. Can be one of the following:

lpRect

Pointer to a CRect or RECT object containing the coordinates of the drawing area.

Remarks

Called by the framework to draw a screen image of a printed page. This image is then displayed as part of the common OLE Page Setup dialog box. The default implementation draws an image of a page of text.

Override this function to customize the drawing of a specific area of the image, or the entire image. You can do this by using a switch statement with case statements checking the value of nMessage. For example, to customize the rendering of the contents of the page image, you could use the following example code:

switch( nType )
{
    case WM_PSD_GREEKTEXTRECT:
      DrawMyImage(pDC, lpRect);    //draws my special graphic
      return 1;
    default:
      return ::Draw(CDC* pDC, UINT nDrawType, LPRECT lpRect);
};

Note that you do not need to handle every case of nMessage. You can choose to handle one component of the image, several components of the image, or the whole area.

CPageSetupDialog OverviewClass MembersHierarchy Chart

See Also   CPageSetupDialog::PreDrawPage