Jump to content

WM ERASEBACKGROUND

From EDM2

This message causes a client window to be filled with the background, should this be appropriate.

Syntax

param1
HPS hpsFrame;   /* Presentation-space handle for the frame window. */

param2
PRECTL pprcPaint; /* Rectangle structure of rectangle to be painted. */

Parameters

hpsFrame (HPS) - Input
Presentation-space handle for the frame window.
pprcPaint (PRECTL) - Input
Pointer to a RECTL structure of the rectangle to be painted.

Returns

rc (BOOL) - returns
Processed indicator.
TRUE: If a FID_CLIENT window exists, the area of the frame covered by the FID_CLIENT window is erased in the system-window background color. If no FID_CLIENT window exists, the entire frame window is erased in the system-window background color.
FALSE: The client window did process the message.

Remarks

The frame window procedure processes this message in the following manner:

  1. The frame window sends this message to the client in response to the frame WM_PAINT message, with the presentation-space handle of the frame window (obtained from WinBeginPaint).
  2. If the client window returns TRUE, the frame window procedure erases the rectangle of the frame window covered by the client window, by filling it with the system color SCLR_WINDOW.
  3. If the client window returns FALSE, no action is taken. This is the default behavior, as WinDefWindowProc returns FALSE if passed this message.
  4. Also, the client window can use the presentation-space handle passed in this message to selectively erase parts of the screen. If the client window processes the message in this way, FALSE should be returned to avoid the erasure being done automatically by the frame window procedure.

It should be noted again that the presentation space is not a client window presentation space; it is a presentation space for the frame window returned by WinBeginPaint, that is, a cached presentation space in frame (not client) window coordinates, clipped to the area of the frame that needs to be updated (possibly including areas outside the client window).

Default Processing

The default window procedure takes no action on this message, other than to set rc to FALSE.