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

> IXtfApplicationClient::QueryExecutionState

# IXtfApplicationClient::QueryExecutionState

Queries the execution state of the app with the specified package moniker.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT QueryExecutionState(
         LPCWSTR pszPackageMoniker,
         DWORD *dwState
)  
```

<a id="parametersSection" />

### Parameters

*pszPackageMoniker*<br />Type: LPCWSTR

A pointer to the package moniker of the app to query.

*dwState*<br />Type: DWORD\*

A pointer that receives the execution state of the app. This parameter is set to one of the values listed in the following table.

| Constant   | Value | Description                                  |
| ---------- | ----- | -------------------------------------------- |
| Unknown    | 0     | The execution state of the app is unknown.   |
| Running    | 1     | The app is currently running.                |
| Suspending | 2     | The app is in the process of suspending.     |
| Suspended  | 3     | Execution of the app is currently suspended. |
| Terminated | 4     | The app has been terminated.                 |

<a id="retvalSection" />

### Return value

Type: HRESULT

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

<a id="remarksSection" />

## Remarks

This method queries the execution state of the app with the specified package name. This method is similar to the `xbapp query` command from the Application Management (xbapp.exe) tool,  included as part of the XBOX Tools Framework (XTF). For more information about the `xbapp query` command, see [Application Management (xbapp.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbapp).

For more information about game life cycle states, see [XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle).

<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)<br />[XtfApplication](/reference/tools/xtf/xtfapplication/xtfapplication-xbox-microsoft-n)


## Related topics

- [IXtfApplicationClient::DebugQuery](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/ixtfapplicationclient-debugquery.md)
- [XtfCreateApplicationClient](/reference/tools/xtf/xtfapplication/methods/xtfcreateapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::Suspend](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/suspend-ixtfapplicationclient-xtfapplication-xbox-windows.md)
- [IXtfApplicationClient::Resume](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/resume-ixtfapplicationclient-xtfapplication-xbox-microsoft-m.md)
- [IXtfApplicationClient::Unconstrain](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/unconstrain-ixtfapplicationclient-xtfapplication-xbox-windows-m.md)
