> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IXtfApplicationClient::SetDefaultApp

> IXtfApplicationClient::SetDefaultApp

# IXtfApplicationClient::SetDefaultApp

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

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

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

<a id="retvalSection" />

### Return value

Type: HRESULT

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

<a id="remarksSection" />

## 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)](/tools/tools-console/commandlinetools/xbapp).

<Note>To maximize future compatibility, your tools should use the `xbapp setdefaultapp` command from the Application Management tool, instead of directly invoking this method.</Note>

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](/reference/system/xgame/functions/xlaunchnewgame), 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.</Note>

<a id="requirementsSection" />

## Requirements

**Header:** xtfapplication.h

**Library:** xtfapplication.lib

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

<a id="seealsoSection" />

## See also

[IXtfApplicationClient Interface](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/ixtfapplicationclient-xtfapplication-xbox-microsoft-t)\
[XtfApplication](/reference/tools/xtf/xtfapplication/xtfapplication-xbox-microsoft-n)


## Related topics

- [IXtfApplicationClient::DeployEx](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/ixtfapplicationclient-deployex.md)
- [IXtfApplicationClient::Deploy](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/deploy-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::DebugEnable](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/debugenable-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::Constrain](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/constrain-ixtfapplicationclient-xtfapplication-xbox-windows-m.md)
- [IXtfApplicationClient::Snap](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/snap-ixtfapplicationclient-xtfapplication-xbox-windows-m.md)
