> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RegisterOcclusionStatusWindow (XBOX Series 主機)

> 註冊應用程式視窗以接收遮蔽狀態變更的通知訊息。

註冊應用程式視窗以接收遮蔽狀態變更的通知訊息。

## 語法

```cpp theme={null}
HRESULT RegisterOcclusionStatusWindow(  
         HWND WindowHandle,  
         UINT wMsg,  
         DWORD* pdwCookie  
)  
```

### 參數

*WindowHandle*   \_In\_\
類型：HWND

發生遮蔽狀態變更時，要傳送通知訊息的視窗控制代碼。

*wMsg*   \_In\_\
類型：UINT

要傳送之通知訊息的識別碼。

*pdwCookie*   \_Out\_\
類型：DWORD\*

指向索引鍵值的指標，應用程式可以將此值傳遞給 [IDXGIFactory2::UnregisterOcclusionStatus](/zh-TW/reference/graphics/d3d12_xs/interfaces/IDXGIFactory2/methods/idxgifactory2_unregisterocclusionstatus) 方法，以取消註冊 *wMsg* 所指定的通知訊息。

### 傳回值

類型：HRESULT

如果成功，則傳回 S\_OK；否則傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

**標頭：** d3d12\_xs.h

**程式庫：** d3d12\_xs.lib\
**支援的平台：** XBOX Series 主機

## 另請參閱

[IDXGIFactory2](/zh-TW/reference/graphics/d3d12_xs/interfaces/IDXGIFactory2/idxgifactory2)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [XBOX Series X|S 總覽](/zh-TW/paths/series-xs/overview.md)
- [Play Anywhere(主機 + PC)總覽](/zh-TW/paths/play-anywhere/overview.md)
- [XBOX 遊戲開發文件](/zh-TW/index.md)
- [XBOX 主機遊戲的認證測試 XBOX 需求](/zh-TW/publishing/certification/console-cert-tested-requirements.md)
