IDXGIFactory2::RegisterOcclusionStatusWindow method (dxgi1_2.h)

Registers an application window to receive notification messages of changes of occlusion status.


HRESULT RegisterOcclusionStatusWindow(
  [in]  HWND  WindowHandle,
  [in]  UINT  wMsg,
  [out] DWORD *pdwCookie


[in] WindowHandle

The handle of the window to send a notification message to when occlusion status change occurs.

[in] wMsg

Identifies the notification message to send.

[out] pdwCookie

A pointer to a key value that an application can pass to the IDXGIFactory2::UnregisterOcclusionStatus method to unregister the notification message that wMsg specifies.

Return value

RegisterOcclusionStatusWindow returns:

  • S_OK if it successfully registered the window.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • DXGI_ERROR_INVALID_CALL if WindowHandle is not a valid window handle or not the window handle that the current process owns.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows 7:  On Windows 7 or Windows Server 2008 R2 with the Platform Update for Windows 7 installed, RegisterOcclusionStatusWindow fails with E_NOTIMPL. For more info about the Platform Update for Windows 7, see Platform Update for Windows 7.


Apps choose the Windows message that Windows sends when occlusion status changes.


Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps only]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header dxgi1_2.h
Library Dxgi.lib

See also