Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This message is sent by an application to a window to enable changes in that window to be redrawn or to prevent changes in that window from being redrawn.

Syntax

WM_SETREDRAW 
wParam = (WPARAM) 
fRedraw; 

lParam = 0;

Parameters

fRedraw

Specifies the state of the redraw flag.

If set to TRUE, the redraw flag is set.

If set to FALSE, the flag is cleared.

lParam

Unused.

Return Value

An application should return zero if it processes this message.

Remarks

The window manager provides no default processing for this message. However, certain controls do support this message, list box, tree view, and combo box.

This message sets or clears the redraw flag. However, if the redraw flag is cleared, the content of the given window is not updated after each change, and the window is not repainted until the redraw flag is set. For example, an application that must add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag.

Use the RedrawWindowfunction rather than the InvalidateRectfunction to repaint the list box. Some controls can have a non-client area on their own and some controls may be based on window styles (WS_THICKFFRAME/WS_BORDER/WS_EX_CLIENTEDGE and other like styles) that cause them to be given a non-client area. Therefore, call the RedrawWindowfunction using the parameters RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_ALLCHILDREN. If the control does not have a non-client area, the RedrawWindowfunction with the specified flags will do only as much invalidation as InvalidateRectwould.

Requirements

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

See Also