Export (0) Print
Expand All

WM_SETREDRAW message

An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.

To send this message, call the SendMessage function with the following parameters.


SendMessage( 
  (HWND) hWnd,              
  WM_SETREDRAW,             
  (WPARAM) wParam,          
  (LPARAM) lParam            
);

Parameters

wParam

The redraw state. If this parameter is TRUE, the content can be redrawn after a change. If this parameter is FALSE, the content cannot be redrawn after a change.

lParam

This parameter is not used.

Return value

An application returns zero if it processes this message.

Remarks

This message can be useful if an application must add several items to a list box. The application can call this message with wParam set to FALSE, add the items, and then call the message again with wParam set to TRUE. Finally, the application can call RedrawWindow(hWnd, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN) to cause the list box to be repainted.

Note  RedrawWindow with the specified flags is used instead of InvalidateRect because the former is necessary for some controls that have nonclient area on their own, or have window styles that cause them to be given a nonclient area (such as WS_THICKFRAME, WS_BORDER, or WS_EX_CLIENTEDGE). If the control does not have a nonclient area, RedrawWindow with these flags will do only as much invalidation as InvalidateRect would.

If the application sends the WM_SETREDRAW message to a hidden window, the window becomes visible (that is, the operating system adds the WS_VISIBLE style to the window).

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Painting and Drawing Overview
Painting and Drawing Messages
RedrawWindow

 

 

Community Additions

ADD
Show:
© 2014 Microsoft