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

# XGameProtocolRegisterForActivation (deprecated)

> XGameProtocolRegisterForActivation (deprecated)

# XGameProtocolRegisterForActivation (deprecated)

<Info>This API is now deprecated. Use [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent) instead.</Info>

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\*](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

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](/reference/errorcodes).

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more</Note>
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](/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback) as an argument.

To unregister a callback for a game
invite event, call [XGameProtocolUnregisterForEvent](/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation).

## Requirements

**Header:** XGameProtocol.h

**Library:** xgameruntime.lib

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

## See also

[XGameProtocol members](/reference/system/xgameprotocol/xgameprotocol_members)


## Related topics

- [XGameProtocolActivationCallbackXGameProtocol (deprecated)](/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback.md)
- [XGameProtocolUnregisterForActivation (deprecated)](/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameProtocol (deprecated)](/reference/system/xgameprotocol/xgameprotocol_members.md)
- [XGameActivation](/reference/system/xgameactivation/xgameactivation_members.md)
- [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md)
