XLaunchUri

The Microsoft Game Development Kit (GDK) Launcher API provides a mechanism that enables games to launch an experience by invoking a URI.

Syntax

HRESULT XLaunchUri(  
         XUserHandle requestingUser,  
         const char* uri  
)  

Parameters

requestingUser   _In_opt_
Type: XUserHandle

Defines a handle identifying the user that makes the request.

uri   _In_z_
Type: char*

String that indicates the URI to launch.

Return value

Type: HRESULT

HRESULT success or error code.

Returns S_OK if successful; otherwise it returns an error code. For a list of error codes, see Error Codes.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

This launches a URI on behalf of a user, and consists of only one method, LaunchUri. It also accepts an optional user context and a required URI.

If successful, the destination URI is launched. Otherwise, an error is returned. This method is not considered time critical, and blocks until the underlying async system operation is completed, and either the destination URI has been launched, or an error has occurred.

If no app exists to handle the given URI's protocol scheme, the system displays a prompt to the user asking if they would like to search the Windows Store for an application that handles that scheme.

Requirements

Header: XLauncher.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XLauncher