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

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](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md) during callback registration.

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

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](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md). 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](https://docs.xbox.com/reference/system/xuser/xuser_members.md)

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


## Related topics

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