共用方式為


WM_ERASEBKGND

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This message is sent by an application when the window background must be erased, for example, when a window is resized. The message is sent to prepare an invalidated portion of a window for painting.

Syntax

WM_ERASEBKGND hdc = (HDC) wParam;

Parameters

  • hdc
    Handle to the device context.

Return Value

An application should return nonzero if it erases the background; otherwise, it should return zero.

Remarks

The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background.

An application should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If the application returns zero, the window will remain marked for erasing. (Typically, this indicates that the fErase member of the PAINTSTRUCT structure will be TRUE.)

Requirements

Header winuser.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

BeginPaint
DefWindowProc
PAINTSTRUCT
WNDCLASS
Windows Messages