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

Unregisters a callback for activation events.

## Syntax

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

### Parameters

*token*   \_In\_\
Type: [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

The token that [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent) returns.

*wait*   \_In\_\
Type: bool

Wait for pending event callbacks to complete.

### Return value

Type: bool

Returns false if *wait* is false and the unregister is pending. Returns true otherwise.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

To register a callback for activation events, call [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent). The function uses a pointer to an [XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback) as an argument.

For an example of calling this function, see the remarks section of the [XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback#remarks) topic.

## Requirements

**Header:** XGameActivation.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [File type activation](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/filetypeactivation)
* [Receiving invites](/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)


## Related topics

- [XGameActivation](/reference/system/xgameactivation/xgameactivation_members.md)
- [XGameProtocolUnregisterForActivation (deprecated)](/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)
- [XGameActivationCallback](/reference/system/xgameactivation/functions/xgameactivationcallback.md)
- [XGameInviteUnregisterForEvent (deprecated)](/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md)
