WM_ERASEBKGND

This message is sent when the window background needs erasing (for example, when a window is resized). It is sent to prepare an invalidated region for painting.

Parameters

wParam

Contains the device-context handle.

lParam

This parameter is not used.

Return Value

The return value is nonzero if the background is erased. Otherwise, it is zero. If the application processes the WM_ERASEBKGND message, it should return the appropriate value.

Default Action

The background is erased, using the class background brush specified by the hbrbackground member of the class structure.

Comments

If hbrbackground is NULL, the application should process the WM_ERASEBKGND message and erase the background color.

Windows assumes the background should be computed by using the MM_TEXT mapping mode. If the device context is using any other mapping mode, the area erased may not be within the visible part of the client area.