Export (0) Print
Expand All
Expand Minimize

RedrawWindow (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function updates the specified rectangle or region in the client area of a window.

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, RedrawWindow updates the desktop window.

lprcUpdate
[in] Pointer to a RECT structure that contains the coordinates, in device units, of the update rectangle.

RedrawWindow ignores this parameter if the hrgnUpdate parameter identifies a region.

hrgnUpdate
[in] Handle to the update region.

If both the hrgnUpdate and lprcUpdate parameters are NULL, RedrawWindow adds the entire client area to the update region.

flags
[in] DWORD that 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 RedrawWindow affects.

The following table shows the values that invalidate the window.

ValueDescription
RDW_ERASECauses the window to receive a WM_ERASEBKGND message when the window is repainted.

Specify this value in combination with the RDW_INVALIDATE value; otherwise, RDW_ERASE has no effect.

RDW_INTERNALPAINTCauses the OS to post a WM_PAINT message to the window regardless of whether a portion of the window is invalid.
RDW_INVALIDATEInvalidates the rectangle or region that you specify in lprcUpdate or 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.

ValueDescription
RDW_NOERASESuppresses any pending WM_ERASEBKGND messages.
RDW_VALIDATEValidates the rectangle or region that you specify in lprcUpdate or 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. RedrawWindow does not repaint unless you specify one of these values.

ValueDescription
RDW_ERASENOWCauses the affected windows, which you specify by setting the RDW_ALLCHILDREN and RDW_NOCHILDREN values, to receive WM_ERASEBKGND messages before RedrawWindow returns, if necessary.

The affected windows receive WM_PAINT messages at the ordinary time.

RDW_UPDATENOWCauses 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 RedrawWindow returns, if necessary.

By default, the set of windows that RedrawWindow affects depends on whether the windows have the WS_CLIPCHILDREN style.

RedrawWindow does not affect child windows that do not have the WS_CLIPCHILDREN style.

RedrawWindow recursively validates or invalidates non-WS_CLIPCHILDREN windows until RedrawWindow encounters a WS_CLIPCHILDREN window.

The following table shows the values that control the windows that RedrawWindow affects.

ValueDescription
RDW_ALLCHILDRENIncludes child windows, if any, in the repainting operation.
RDW_NOCHILDRENExcludes child windows, if any, from the repainting operation.

Return Values

A nonzero value indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

WM_ERASEBKGND | WM_PAINT | RECT


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft