> ## 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.

# XAppBroadcastRegisterIsAppBroadcastingChanged

> XAppBroadcastRegisterIsAppBroadcastingChanged

# XAppBroadcastRegisterIsAppBroadcastingChanged

註冊應用程式廣播狀態變更事件處理常式。

## 語法

```cpp theme={null}
HRESULT XAppBroadcastRegisterIsAppBroadcastingChanged(  
         XTaskQueueHandle queue,  
         void* context,  
         XAppBroadcastMonitorCallback* appBroadcastMonitorCallback,  
         XTaskQueueRegistrationToken* token  
)  
```

### 參數

*queue*   \_In\_opt\_\
類型：XTaskQueueHandle

選擇性的 XTaskQueueHandle，使用者可在其中建立自己的回呼，以便從此佇列執行。

*context*   \_In\_opt\_\
類型：void\*

要傳遞至回呼函式的選擇性資訊。

*appBroadcastMonitorCallback*   \_In\_\
類型：XAppBroadcastMonitorCallback\*

當您是否可以廣播的狀態變更時的回呼。遊戲可以使用此回呼來得知是否可以安全地啟用顯示廣播 UI。

*token*   \_Out\_\
類型：XTaskQueueRegistrationToken\*

廣播權杖。

### 傳回值

類型：HRESULT

函式結果。

## 備註

<Note>在時間敏感執行緒上呼叫此函式並不安全。如需詳細資訊，請參閱[時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。</Note>

每次呼叫 **AppBroadcastRegisterIsAppBroadcastingChanged** 之後，都應該在不再需要事件處理常式時呼叫 [XAppBroadcastUnregisterIsAppBroadcastingChanged](/zh-TW/reference/system/xappcapture/functions/xappbroadcastunregisterisappbroadcastingchanged)。若未呼叫取消註冊函式，將會導致記憶體流失。此函式會註冊第二個函式 [XAppBroadcastMonitorCallback](/zh-TW/reference/system/xappcapture/functions/xappbroadcastmonitorcallback)，當應用程式廣播的狀態變更時就會呼叫該函式。

## 需求

**標頭：** XAppCapture.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 概念文件

* [時間敏感執行緒](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另請參閱

[GameDVR 概觀](/zh-TW/build/console-features/game-dvr/gamedvr-broadcast)\
[XAppCapture 成員](/zh-TW/reference/system/xappcapture/xappcapture_members)\
[XAppBroadcastUnregisterIsAppBroadcastingChanged](/zh-TW/reference/system/xappcapture/functions/xappbroadcastunregisterisappbroadcastingchanged)\
[XAppBroadcastMonitorCallback](/zh-TW/reference/system/xappcapture/functions/xappbroadcastmonitorcallback)


## Related topics

- [XAppBroadcastRegisterIsAppBroadcastingChanged](/reference/system/xappcapture/functions/xappbroadcastregisterisappbroadcastingchanged.md)
- [XAppBroadcastUnregisterIsAppBroadcastingChanged](/reference/system/xappcapture/functions/xappbroadcastunregisterisappbroadcastingchanged.md)
- [XAppBroadcastMonitorCallback](/reference/system/xappcapture/functions/xappbroadcastmonitorcallback.md)
- [XAppCapture](/reference/system/xappcapture/xappcapture_members.md)
- [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
