> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/zh-TW/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

[XGameActivationRegisterForEvent](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md) 傳回的權杖。

*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)。

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

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

## 需求

**標頭：** XGameActivation.h

**程式庫：** xgameruntime.lib

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

## 概念文件

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

## 另請參閱

[XGameActivation](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/xgameactivation_members.md)

[XGameActivationRegisterForEvent](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)

[XGameActivationCallback](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/functions/xgameactivationcallback.md)


## Related topics

- [XGameActivation (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/xgameactivation_members.md)
- [XGameActivationRegisterForEvent](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)
- [XGameActivationCallback](https://docs.xbox.com/zh-TW/reference/system/xgameactivation/functions/xgameactivationcallback.md)
- [XGameProtocolUnregisterForActivation (已淘汰)](https://docs.xbox.com/zh-TW/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameInviteUnregisterForEvent (已淘汰)](https://docs.xbox.com/zh-TW/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md)
