win12.hlp (Table of Contents; Topic list)
WinInvalidateRect (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
BOOL WinInvalidateRect(hwnd, prcl, fIncludeChildren)
HWND hwnd;                /* handle of window with changed update region */
PRECTL prcl;              /* address of structure with rectangle         */
BOOL fIncludeChildren;    /* invalidation-scope flag                     */
 
The WinInvalidateRect function adds a rectangle to a window's update region.
The update region represents the area of the window that must be redrawn.
 
Parameter         Description
────────────────────────────────────────────────────────────────────────────
 
hwnd              Identifies the window whose update region has changed. If
                  this parameter is HWND_DESKTOP, this function updates the
                  entire screen.
 
prcl              Points to the RECTL structure that contains the
                  coordinates of the rectangle to add to the window's update
                  region. If this parameter is NULL, the entire window is
                  put into the update region.
 
fIncludeChildren  Specifies whether child windows of hwnd are included in
                  the invalid rectangle. If TRUE, child windows are
                  included. If FALSE, they are not.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Comments
 
If the window style is WS_SYNCPAINT, the window is redrawn before returning
from the WinInvalidateRect function.
 
If the window style is WS_CLIPCHILDREN and part of the window's update
region overlaps child windows that have the style WS_SYNCPAINT, those child
windows are updated before WinInvalidateRect returns.
 
Example
 
This example gets the dimensions of the window and calls WinInvalidateRect
to invalidate the window. The application will be sent a WM_PAINT message
with the entire window as the update rectangle.
 
WinQueryWindowRect(hwnd, &rcl);
WinInvalidateRect(hwnd,   /* window to invalidate    */
    &rcl,                 /* invalid rectangle       */
    FALSE);               /* do not include children */
 
See Also
 
WinInvalidateRegion, RECTL, WM_PAINT