> ## 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::Constrain

> IXtfApplicationClient::Constrain

# IXtfApplicationClient::Constrain

Places the app with the specified package moniker into constrained mode.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT Constrain(
         LPCWSTR pszPackageMoniker
)  
```

<a id="parametersSection" />

### Parameters

*pszPackageMoniker*<br />Type: LPCWSTR

A pointer to the package moniker for the app that is to be put into constrained mode.

<a id="retvalSection" />

### Return value

Type: HRESULT

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

<a id="remarksSection" />

## Remarks

This function puts the app specified in `pszPackageMoniker` into constrained mode. While in constrained mode, the app has reduced access to reserved system resources. Use the [Unconstrain](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/unconstrain-ixtfapplicationclient-xtfapplication-xbox-windows-m) method to leave constrained mode and return to full mode. For more information about game life cycle states, see [XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle).

For more information about how to use XBOX Tools Framework (XTF) to constrain and unconstrain an app for testing, see [Application Management (xbapp.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbapp).

<a id="requirementsSection" />

## Requirements

**Header:** xtfapplication.h

**Library:** xtfapplication.lib

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

<a id="seealsoSection" />

## See also

[IXtfApplicationClient::Unconstrain](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/unconstrain-ixtfapplicationclient-xtfapplication-xbox-windows-m)<br />[IXtfApplicationClient](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/ixtfapplicationclient-xtfapplication-xbox-microsoft-t)<br />[XtfApplication](/reference/tools/xtf/xtfapplication/xtfapplication-xbox-microsoft-n)


## Related topics

- [IXtfApplicationClient::Unconstrain](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/unconstrain-ixtfapplicationclient-xtfapplication-xbox-windows-m.md)
- [XtfCreateApplicationClient](/reference/tools/xtf/xtfapplication/methods/xtfcreateapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::Deploy](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/deploy-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::Snap](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/snap-ixtfapplicationclient-xtfapplication-xbox-windows-m.md)
- [IXtfApplicationClient::Suspend](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/suspend-ixtfapplicationclient-xtfapplication-xbox-windows.md)
