Skip to main content

XUserRegisterForChangeEvent

Registers a callback for a user change event.

Syntax

Parameters

queue   _In_opt_
Type: XTaskQueueHandle
A handle to the asynchronous queue to perform the operation on. context   _In_opt_
Type: void*
User defined context to pass to the callback. callback   _In_
Type: XUserChangeEventCallback*
User defined callback to register. token   _Out_
Type: XTaskQueueRegistrationToken*
Contains a token identifying the registered callback. Use the token to un-register the callback.

Return value

Type: HRESULT HRESULT success or error code.
For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
The XUserChangeEvent enumeration specifies a change event type. XUserChangeEventCallback is a callback for a user change event. To unregister a previously registered user change callback, call XUserUnregisterForChangeEvent. The following example demonstrates how to handle user change events.

Requirements

Header: XUser.h Library: xgameruntime.lib Supported platforms: Windows, Steam Deck, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XUser XUserChangeEvent XUserChangeEventCallback XUserUnregisterForChangeEvent
Last modified on August 20, 2026