> ## 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\_\
類型：void\*

應用程式定義的內容，會在註冊回呼期間傳送至 [XUserRegisterForDeviceAssociationChanged](/zh-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)。

*change*   \_In\_\
類型：[XUserDeviceAssociationChange\*](/zh-TW/reference/system/xuser/structs/xuserdeviceassociationchange)

包含舊的和新的裝置關聯的結構。

### 傳回值

類型：void

## 備註

若要為使用者裝置關聯變更事件註冊回呼，請呼叫 [XUserRegisterForDeviceAssociationChanged](/zh-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)。此函式會接受指向 **XUserDeviceAssociationChangedCallback** 函式的指標作為引數。此函式會傳回回呼函式的指標。

## 需求

**標頭：** XUser.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XUser](/zh-TW/reference/system/xuser/xuser_members)

[XUserRegisterForDeviceAssociationChanged](/zh-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)


## Related topics

- [XUserDeviceAssociationChangedCallback](/reference/system/xuser/functions/xuserdeviceassociationchangedcallback.md)
- [XUserDeviceAssociationChange](/reference/system/xuser/structs/xuserdeviceassociationchange.md)
