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

A callback that invokes when the user-device association changes.

## Syntax

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

### Parameters

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

The context the application defines and sends to [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) during callback registration.

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

A structure that contains the old and new device associations.

### Return value

Type: void

## Remarks

To register a callback for user device association change events, call [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged). The function takes a pointer to an **XUserDeviceAssociationChangedCallback** function as an argument. The function returns the pointer to the callback function.

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

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

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


## Related topics

- [XUserDeviceAssociationChange](/reference/system/xuser/structs/xuserdeviceassociationchange.md)
- [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserFindForDevice](/reference/system/xuser/functions/xuserfindfordevice.md)
- [When do user-to-controller associations take place?](/build/core-features/common/user/users-timing-of-user-to-device-association.md)
- [Users and input devices](/build/core-features/common/user/users-input-devices.md)
