WinUpdateWindow
This function forces the update of a window and its associated child windows.
Syntax
WinUpdateWindow(hwnd)
Parameters
- hwnd (HWND) - Input
- Window handle.
Returns
- rc (BOOL) - returns
- Window-updated indicator.
- TRUE
- Window successfully updated.
- FALSE
- Window not successfully updated.
Remarks
If hwnd is an asynchronous window (doesn't have the WS_SYNCPAINT style), only it and its asynchronous children are updated. They receive WM_PAINT messages from this function. If the window belongs to a different thread than the caller, the message is sent asynchronously using WinPostMsg instead of synchronously using WinSendMsg.
If the window has no invalid region, a WM_PAINT message might not be sent.
If hwnd is a child of a non-clip-children parent, its update region is subtracted from the parent's update region (if the parent has one). This prevents the parent from drawing over what the child window draws.
Errors
Possible returns from WinGetLastError:
- PMERR_INVALID_HWND (0x1001) - An invalid window handle was specified.
Example Code
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HWND hwnd; /* Window handle. */ BOOL rc; /* Window-updated indicator. */ rc = WinUpdateWindow(hwnd);
This example sends a WM_PAINT message to a window procedure.
#define INCL_WINWINDOWMGR #include <OS2.H> #define WM_USERDEF WM_USER + 1 main() { } static MRESULT ClientWindowProc( HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2 ) { switch(msg) { case WM_PAINT: break; case WM_USERDEF: WinUpdateWindow(hwnd); } }
Related Messages
Related Functions
- WinBeginPaint
- WinEnableWindowUpdate
- WinEndPaint
- WinExcludeUpdateRegion
- WinGetClipPS
- WinGetPS
- WinGetScreenPS
- WinInvalidateRect
- WinInvalidateRegion
- WinIsWindowShowing
- WinIsWindowVisible
- WinLockVisRegions
- WinOpenWindowDC
- WinQueryUpdateRect
- WinQueryUpdateRegion
- WinRealizePalette
- WinReleasePS
- WinShowWindow
- WinValidateRect
- WinValidateRegion