2 out of 2 rated this helpful - Rate this topic

WM_PRINT message

Applies to: desktop apps only

The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.

A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
  HWND hwnd, 
  UINT  uMsg, 
  WPARAM wParam, 
  LPARAM lParam     
);

Parameters

wParam

A handle to the device context to draw in.

lParam

The drawing options. This parameter can be one or more of the following values.

ValueMeaning
PRF_CHECKVISIBLE

Draws the window only if it is visible.

PRF_CHILDREN

Draws all visible children windows.

PRF_CLIENT

Draws the client area of the window.

PRF_ERASEBKGND

Erases the background before drawing the window.

PRF_NONCLIENT

Draws the nonclient area of the window.

PRF_OWNED

Draws all owned windows.

 

Remarks

The DefWindowProc function processes this message based on which drawing option is specified: if PRF_CHECKVISIBLE is specified and the window is not visible, do nothing, if PRF_NONCLIENT is specified, draw the nonclient area in the specified device context, if PRF_ERASEBKGND is specified, send the window a WM_ERASEBKGND message, if PRF_CLIENT is specified, send the window a WM_PRINTCLIENT message, if PRF_CHILDREN is set, send each visible child window a WM_PRINT message, if PRF_OWNED is set, send each visible owned window a WM_PRINT message.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Painting and Drawing Overview
Painting and Drawing Messages
DefWindowProc
WM_ERASEBKGND
WM_PRINTCLIENT

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ