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. |
This function updates the specified rectangle or region in the client area of a window.
Syntax
BOOL WINAPI RedrawWindow( HWND hwnd, CONST RECT* lprcUpdate, HRGN hrgnUpdate, UINT flags ); |
Parameters
- hwnd
-
[in] Handle to the window that you want to redraw.
If this parameter is NULL, RedrawWindowupdates the desktop window.
- lprcUpdate
-
[in] Pointer to a RECTstructure that contains the coordinates, in device units, of the update rectangle.
RedrawWindowignores this parameter if the hrgnUpdateparameter identifies a region.
- hrgnUpdate
-
[in] Handle to the update region.
If both the hrgnUpdateand lprcUpdateparameters are NULL, RedrawWindowadds the entire client area to the update region.
- flags
-
[in] DWORDthat specifies one or more redraw options.
You can use this parameter to invalidate or validate a window, control when repainting occurs, and control the windows that RedrawWindowaffects.
The following table shows the values that invalidate the window.
Value Description RDW_ERASE
Causes the window to receive a WM_ERASEBKGNDmessage when the window is repainted.
Specify this value in combination with the RDW_INVALIDATE value; otherwise, RDW_ERASE has no effect.
RDW_INTERNALPAINT
Causes the OS to post a WM_PAINTmessage to the window regardless of whether a portion of the window is invalid.
RDW_INVALIDATE
Invalidates the rectangle or region that you specify in lprcUpdateor hrgnUpdate.
You can set only one of these parameters to a non-NULL value.
If both are NULL, RDW_INVALIDATE invalidates the entire window.
The following table shows the values that validate the window.
Value Description RDW_NOERASE
Suppresses any pending WM_ERASEBKGND messages.
RDW_VALIDATE
Validates the rectangle or region that you specify in lprcUpdateor hrgnUpdate.
You can set only one of these parameters to a non-NULL value.
If both are NULL, RDW_VALIDATE validates the entire window.
This value does not affect internal WM_PAINT messages.
The following table shows the values that control when repainting occurs. RedrawWindowdoes not repaint unless you specify one of these values.
Value Description RDW_ERASENOW
Causes the affected windows, which you specify by setting the RDW_ALLCHILDREN and RDW_NOCHILDREN values, to receive WM_ERASEBKGND messages before RedrawWindowreturns, if necessary.
The affected windows receive WM_PAINT messages at the ordinary time.
RDW_UPDATENOW
Causes the affected windows, which you specify by setting the RDW_ALLCHILDREN and RDW_NOCHILDREN values, to receive WM_ERASEBKGND and WM_PAINT messages before the RedrawWindowreturns, if necessary.
By default, the set of windows that RedrawWindowaffects depends on whether the windows have the WS_CLIPCHILDREN style.
RedrawWindowdoes not affect child windows that do not have the WS_CLIPCHILDREN style.
RedrawWindowrecursively validates or invalidates non-WS_CLIPCHILDREN windows until RedrawWindowencounters a WS_CLIPCHILDREN window.
The following table shows the values that control the windows that RedrawWindowaffects.
Value Description RDW_ALLCHILDREN
Includes child windows, if any, in the repainting operation.
RDW_NOCHILDREN
Excludes child windows, if any, from the repainting operation.
Return Value
A nonzero value indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Requirements
Header | windows.h |
Library | coredll.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |