Syntax
BOOL UpdateWindow(
[in] HWND hWnd
);
C++
Parameters
| Parameter | Type | Description |
|---|---|---|
hWnd |
[in] HWND |
A handle to the window to be updated. |
Return value
| Type | Description |
|---|---|
BOOL |
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. |
Remarks
The UpdateWindow function sends a WM_PAINT message to a window, even if the window's update region is not marked as updated. If the window's update region is empty, the function does not send a WM_PAINT message.
The UpdateWindow function sends the WM_PAINT message directly to the window procedure associated with the window specified by the hWnd parameter. The Send-Message function posts messages to the message queue of the thread or threads that created the window.
To retrieve and dispatch any pending window messages, including WM_PAINT messages, use the UpdateWindow function.
Note An application sends a
WM_PAINT message to a window when the update region has not been invalidated. This is useful for applications that can paint their client area without relying on the system to invalidate the entire client area.
For more information on updating windows, see Window Updates.
Requirements
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | winuser.h (include Windows.h) |