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

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

## Syntax

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

### Parameters

*token*   \_In\_\
类型：[XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

[XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent) 返回的令牌。

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

若要注册激活事件的回调，请调用 [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent)。该函数使用指向 [XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback) 的指针作为参数。

有关调用此函数的示例，请参阅 [XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback#remarks) 主题的“备注”部分。

## Requirements

**头文件：** XGameActivation.h

**库：** xgameruntime.lib

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

## Conceptual documentation

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

## See also

[XGameActivation](/reference/system/xgameactivation/xgameactivation_members)

[XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent)

[XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback)
