BOOL LockWindowUpdate(hwndLock) | ||||
HWND hwndLock; | /* handle of window, */ |
The LockWindowUpdate function disables or reenables drawing in the given window. A locked window cannot be moved. Only one window can be locked at a time.
hwndLock
Identifies the window in which drawing will be disabled. If this parameter is NULL, drawing in the locked window is enabled.
The return value is nonzero if the function is successful. It is zero if a failure occurs or if the LockWindowUpdate function has been used to lock another window.
If an application with a locked window (or any locked child windows) calls the GetDC, GetDCEx, or BeginPaint function, the called function returns a device context whose visible region is empty. This will occur until the application unlocks the window by calling LockWindowUpdate, specifying a value of NULL for hwndLock.
While window updates are locked, the system keeps track of the bounding rectangle of any drawing operations to device contexts associated with a locked window. When drawing is reenabled, this bounding rectangle is invalidated in the locked window and its child windows to force an eventual WM_PAINT message to update the screen. If no drawing has occurred while the window updates were locked, no area is invalidated.
The LockWindowUpdate function does not make the given window invisible and does not clear the WS_VISIBLE style bit.