Skip to main content

XGameActivationRegisterForEvent

Registers a callback for activation events.

Syntax

Parameters

queue   _In_opt_
Type: XTaskQueueHandle
The task queue that dispatches the event callback. context   _In_opt_
Type: void*
The context passed to the event callback. callback   _In_
Type: XGameActivationCallback*
The event callback function. token   _Out_
Type: XTaskQueueRegistrationToken*
A token from the task queue that represents the registration. Use the token to unregister the callback for activation events.

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 XGameActivationRegisterForEvent function uses an XGameActivationCallback as an argument. The callback receives an XGameActivationInfo structure that contains the activation type and corresponding data. This API handles all activation types including protocol activation, file activation, and game invites. It replaces the deprecated XGameProtocolRegisterForActivation and XGameInviteRegisterForEvent APIs. To unregister a callback for activation events, call XGameActivationUnregisterForEvent. For an example of calling this function, see the remarks section of the XGameActivationCallback topic.

Requirements

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

Conceptual documentation

See also

XGameActivation XGameActivationCallback XGameActivationUnregisterForEvent
Last modified on August 20, 2026