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

# XUserDeviceAssociationChangedCallback

> XUserDeviceAssociationChangedCallback

# XUserDeviceAssociationChangedCallback

ユーザーとデバイスの関連付けが変化したときに呼び出されるコールバックです。

## 構文

```cpp theme={null}
void XUserDeviceAssociationChangedCallback(  
         void* context,  
         const XUserDeviceAssociationChange* change  
)  
```

### パラメーター

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

コールバックの登録時にアプリケーションが定義し、[XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) に渡すコンテキストです。

*change*   \_In\_\
Type: [XUserDeviceAssociationChange\*](/reference/system/xuser/structs/xuserdeviceassociationchange)

以前および新しいデバイス関連付けを含む構造体です。

### 戻り値

Type: void

## 解説

ユーザー デバイスの関連付け変化イベントに対するコールバックを登録するには、[XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) を呼び出します。この関数は、引数として **XUserDeviceAssociationChangedCallback** 関数へのポインターを受け取ります。関数はコールバック関数へのポインターを返します。

## 要件

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

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

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

## 関連項目

[XUser](/reference/system/xuser/xuser_members)

[XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)


## Related topics

- [XUserDeviceAssociationChange](/ja-jp/reference/system/xuser/structs/xuserdeviceassociationchange.md)
- [XUserFindForDevice](/ja-jp/reference/system/xuser/functions/xuserfindfordevice.md)
- [XUserRegisterForDeviceAssociationChanged](/ja-jp/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [ユーザーとコントローラーの関連付けが発生するのはいつか?](/ja-jp/build/core-features/common/user/users-timing-of-user-to-device-association.md)
- [XR-115 プレイ中のユーザーまたはコントローラーの追加と削除](/ja-jp/publishing/certification/xr/xr-115.md)
