> ## 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 (非推奨)

> XGameProtocolRegisterForActivation (deprecated)

# XGameProtocolRegisterForActivation (deprecated)

> [!NOTE]
>
> この API は非推奨になりました。代わりに [XGameActivationRegisterForEvent](https://docs.xbox.com/ja-jp/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md) を使用してください。

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

## 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\*](https://docs.xbox.com/ja-jp/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

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

### Return value

型: HRESULT

HRESULT の成功またはエラー コード。\
エラー コードの一覧については、[エラー コード](https://docs.xbox.com/ja-jp/reference/errorcodes.md)を参照してください。

## Remarks

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

**XGameProtocolRegisterForActivation** 関数は、[XGameProtocolActivationCallback](https://docs.xbox.com/ja-jp/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback.md) を引数として使用します。

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

## Requirements

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

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

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

## See also

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


## Related topics

- [XGameProtocolActivationCallbackXGameProtocol (非推奨)](https://docs.xbox.com/ja-jp/reference/system/xgameprotocol/functions/xgameprotocolactivationcallback.md)
- [XGameProtocol (非推奨)](https://docs.xbox.com/ja-jp/reference/system/xgameprotocol/xgameprotocol_members.md)
- [XGameProtocolUnregisterForActivation (非推奨)](https://docs.xbox.com/ja-jp/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [XGameInviteRegisterForEvent (非推奨)](https://docs.xbox.com/ja-jp/reference/system/xgameinvite/functions/xgameinviteregisterforevent.md)
- [IGameInput::RegisterGuideButtonCallback (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_registerguidebuttoncallback.md)
