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

# XGameProtocolRegisterForActivation (deprecated)

> XGameProtocolRegisterForActivation (deprecated)

> [!NOTE]
>
> This API is now deprecated. Use [XGameActivationRegisterForEvent](https://docs.xbox.com/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md) instead.

Registers a callback for protocol activation.

## Syntax

```cpp theme={null}
STDAPI XGameProtocolRegisterForActivation(
    _In_opt_ XTaskQueueHandle queue,
    _In_opt_ void* context,
    _In_ XGameProtocolActivationCallback * callback,
    _Out_ XTaskQueueRegistrationToken* token
    ) noexcept;
```

### Parameters

*queue*   \_In\_opt\_\
Type: XTaskQueueHandle

The task queue that dispatches the event callback.

*context*   \_In\_opt\_\
Type: void\*

The context we pass to the event callback.

*callback*   \_In\_\
Type: XGameProtocolActivationCallback\*

The event callback function.

*token*   \_Out\_\
Type: [XTaskQueueRegistrationToken\*](https://docs.xbox.com/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

A token from the task queue that represents the registration. Use the token to unregister the callback
for protocol activation.

### Return value

Type: HRESULT

HRESULT success or error code.\
For a list of error codes, see [Error Codes](https://docs.xbox.com/reference/errorcodes.md).

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

The **XGameProtocolRegisterForActivation** function uses an
[XGameProtocolActivationCallback](https://docs.xbox.com/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback.md) as an argument.

To unregister a callback for a game
invite event, call [XGameProtocolUnregisterForEvent](https://docs.xbox.com/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md).

## Requirements

**Header:** XGameProtocol.h

**Library:** xgameruntime.lib

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

## See also

[XGameProtocol members](https://docs.xbox.com/reference/system/xgameprotocol/xgameprotocol_members.md)


## Related topics

- [XGameProtocolActivationCallbackXGameProtocol (deprecated)](https://docs.xbox.com/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback.md)
- [XGameProtocolUnregisterForActivation (deprecated)](https://docs.xbox.com/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameProtocol (deprecated)](https://docs.xbox.com/reference/system/xgameprotocol/xgameprotocol_members.md)
- [XGameActivationRegisterForEvent](https://docs.xbox.com/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)
- [XGameActivation (API contents)](https://docs.xbox.com/reference/system/xgameactivation/xgameactivation_members.md)
