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

# SetDefaultApp

> IXtfApplicationClient::SetDefaultApp

Sets the ID of the application to launch when an activation request is received for a specific title ID.

## Syntax

```cpp theme={null}
public:
HRESULT SetDefaultApp(
         LPCWSTR pszTitleId,
         LPCWSTR pszAumid
)  
```

### Parameters

*pszTitleId*\
Type: LPCWSTR

The title ID scheme to change the defaults for.

*pszAumid*\
Type: LPCWSTR

A pointer to a string that contains the AUMID of the app to launch.

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

## Remarks

This method sets the ID of the application to launch when an activation request is received for a specific title ID. This method is similar to the `xbapp setdefaultapp` command from the Application Management (xbapp.exe) tool, included as part of the XBOX Tools Framework (XTF). For more information about the `xbapp setdefaultapp` command, see [Application Management (xbapp.exe) (NDA topic)](https://docs.xbox.com/tools/tools-console/commandlinetools/xbapp.md).

> [!NOTE]
>
> To maximize future compatibility, your tools should use the `xbapp setdefaultapp` command from the Application Management tool, instead of directly invoking this method.

The default App User Model ID (AUMID) specified in `pszAumid` determines which version of an application to launch when a game is launched from the shell or when another app launches the game.

> [!NOTE]
>
> When a title calls [XLaunchNewGame](https://docs.xbox.com/reference/system/xgame/functions/xlaunchnewgame.md), the default value is temporarily overridden with the AUMID of the currently running version of the title, to ensure that the same version is launched on restart.

## Requirements

**Header:** xtfapplication.h

**Library:** xtfapplication.lib

**Supported platforms:** Windows (for XBOX console tools)

## See also

[IXtfApplicationClient Interface](https://docs.xbox.com/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/ixtfapplicationclient-xtfapplication-xbox-microsoft-t.md)\
[XtfApplication](https://docs.xbox.com/reference/tools/xtf/xtfapplication/xtfapplication-xbox-microsoft-n.md)


## Related topics

- [IXtfApplicationClient Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/ixtfapplicationclient-xtfapplication-xbox-microsoft-t.md)
- [Developer Home on the console (Dev Home)](https://docs.xbox.com/tools/tools-console/devhome/devhome.md)
- [XBOX Manager: managing consoles and groups](https://docs.xbox.com/tools/tools-console/xbom/manager-tool-groups.md)
- [GSDK Project Setup](https://docs.xbox.com/services/playfab/multiplayer/servers/server-sdks/unreal-gsdk/third-person-mp-example-gsdk-project-setup.md)
- [Open and restrictive licensing models](https://docs.xbox.com/publishing/game-publishing/concepts/licensing/open-and-restrictive-licensing.md)
