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

# XUserDeviceAssociationChangedCallback

> XUserDeviceAssociationChangedCallback

# XUserDeviceAssociationChangedCallback

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

## 構文

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

### パラメーター

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

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

*change*   \_In\_\
Type: [XUserDeviceAssociationChange\*](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xuserdeviceassociationchange.md)

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

### 戻り値

Type: void

## 解説

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

## 要件

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

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

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

## 関連項目

[XUser](https://docs.xbox.com/ja-jp/reference/system/xuser/xuser_members.md)

[XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)


## Related topics

- [XUserDeviceAssociationChange](https://docs.xbox.com/ja-jp/reference/system/xuser/structs/xuserdeviceassociationchange.md)
- [XUserFindForDevice](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfindfordevice.md)
- [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [ユーザーとコントローラーの関連付けが発生するのはいつか?](https://docs.xbox.com/ja-jp/build/core-features/common/user/users-timing-of-user-to-device-association.md)
- [XUserFindControllerForUserWithUiAsync](https://docs.xbox.com/ja-jp/reference/system/xuser/functions/xuserfindcontrollerforuserwithuiasync.md)
