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

# XGameActivationUnregisterForEvent

> XGameActivationUnregisterForEvent

# XGameActivationUnregisterForEvent

取消註冊啟用事件的回呼。

## 語法

```cpp theme={null}
bool XGameActivationUnregisterForEvent(  
         XTaskQueueRegistrationToken token,  
         bool wait  
)  
```

### 參數

*token*   \_In\_\
類型：[XTaskQueueRegistrationToken](/zh-TW/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

[XGameActivationRegisterForEvent](/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent) 傳回的權杖。

*wait*   \_In\_\
類型：bool

等候擱置中的事件回呼完成。

### 傳回值

類型：bool

如果 *wait* 為 false 且取消註冊仍在擱置中，則傳回 false。否則傳回 true。

## 備註

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

若要註冊啟用事件的回呼，請呼叫 [XGameActivationRegisterForEvent](/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent)。此函式會使用 [XGameActivationCallback](/zh-TW/reference/system/xgameactivation/functions/xgameactivationcallback) 的指標作為引數。

如需呼叫此函式的範例，請參閱 [XGameActivationCallback](/zh-TW/reference/system/xgameactivation/functions/xgameactivationcallback#remarks) 主題的備註一節。

## 需求

**標頭：** XGameActivation.h

**程式庫：** xgameruntime.lib

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

## 概念文件

* [檔案類型啟用](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)
* [接收邀請](/zh-TW/services/xbox-services/multiplayer/invites/how-to/live-invites-receive)

## 另請參閱

[XGameActivation](/zh-TW/reference/system/xgameactivation/xgameactivation_members)

[XGameActivationRegisterForEvent](/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent)

[XGameActivationCallback](/zh-TW/reference/system/xgameactivation/functions/xgameactivationcallback)


## Related topics

- [XGameActivationUnregisterForEvent](/reference/system/xgameactivation/functions/xgameactivationunregisterforevent.md)
- [XGameActivation](/reference/system/xgameactivation/xgameactivation_members.md)
