LockWindowUpdate

  BOOL LockWindowUpdate(hwndLock)    
  HWND hwndLock; /* window where drawing will be disabled */

The LockWindowUpdate disables or reenables drawing in the specified window. Only one window can be locked at a time.

Parameters

hwndLock

Specifies the window where drawing will be disabled. If hwndLock is NULL, drawing in the locked window is enabled.

Return Value

The return value is TRUE if the function is successful. The return value is FALSE if if a failure occurred, or if the LockWindowUpdate function has been used to lock another window.

Comments

Calls to GetDC, GetDCEx, or BeginPaint with a locked window or any of its children will return a DC with an empty visible region, until LockWindowUpdate is called with NULL to unlock updating.

While window updates are locked, the system keeps track of the bounding rectangle of any drawing operations to DCs associated with a locked window. When drawing is reenabled, this bounding rectangle is invalidated in the locked window and its children 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 specified window invisible; it does not clear the WS_VISIBLE style bit.