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

取消注册激活事件的回调。

## Syntax

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

### Parameters

*token*   \_In\_\
类型：[XTaskQueueRegistrationToken](https://docs.xbox.com/zh-CN/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

[XGameActivationRegisterForEvent](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md) 返回的令牌。

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

等待挂起的事件回调完成。

### Return value

类型：bool

如果 *wait* 为 false 且取消注册正在挂起，则返回 false。否则返回 true。

## Remarks

> [!NOTE]
>
> 此函数在时间敏感型线程上调用是不安全的。有关详细信息，请参阅[时间敏感型线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。

若要注册激活事件的回调，请调用 [XGameActivationRegisterForEvent](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)。该函数使用指向 [XGameActivationCallback](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationcallback.md) 的指针作为参数。

有关调用此函数的示例，请参阅 [XGameActivationCallback](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationcallback.md#remarks) 主题的“备注”部分。

## Requirements

**头文件：** XGameActivation.h

**库：** xgameruntime.lib

**受支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## Conceptual documentation

* [文件类型激活](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)
* [接收邀请](https://docs.xbox.com/zh-CN/services/xbox-services/multiplayer/invites/how-to/live-invites-receive.md)

## See also

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

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

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


## Related topics

- [XGameActivation（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/xgameactivation_members.md)
- [XGameActivationRegisterForEvent](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)
- [XGameProtocolUnregisterForActivation (deprecated)](https://docs.xbox.com/zh-CN/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameActivationCallback](https://docs.xbox.com/zh-CN/reference/system/xgameactivation/functions/xgameactivationcallback.md)
- [XGameInviteUnregisterForEvent (deprecated)](https://docs.xbox.com/zh-CN/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md)
