> ## 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>この API は非推奨になりました。代わりに [XGameActivationRegisterForEvent](/reference/system/xgameactivation/functions/xgameactivationregisterforevent) を使用してください。</Info>

プロトコル アクティブ化のコールバックを登録します。

## 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\_\
型: XTaskQueueHandle

イベント コールバックをディスパッチするタスク キュー。

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

イベント コールバックに渡すコンテキスト。

*callback*   \_In\_\
型: XGameProtocolActivationCallback\*

イベント コールバック関数。

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

登録を表すタスク キューからのトークン。このトークンを使用して、プロトコル アクティブ化のコールバックの登録を解除します。

### Return value

型: HRESULT

HRESULT の成功またはエラー コード。\
エラー コードの一覧については、[エラー コード](/reference/errorcodes)を参照してください。

## Remarks

<Note>この関数は、時間依存スレッドから呼び出しても安全ではありません。詳細については、</Note>
[Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads) を参照してください。

**XGameProtocolRegisterForActivation** 関数は、[XGameProtocolActivationCallback](/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback) を引数として使用します。

ゲーム招待イベントのコールバックの登録を解除するには、[XGameProtocolUnregisterForEvent](/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation) を呼び出します。

## Requirements

**ヘッダー:** XGameProtocol.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## See also

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


## Related topics

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