ApplicationExecutionState Enumeration

Specifies the execution state of the app.

Syntax

public enum class ApplicationExecutionState  

Remarks

This table provides more detail about when you’ll see each of these states and what your app should do in response.

State When this state is seen What your app should do
NotRunning The user first activates the app after:
  • installing the app from the Store
  • clicking End task in Task Manager while the app is running
  • rebooting the computer
  • logging off and back on
The user closes the app through the close gesture or Alt+F4 and activates it within about 10 seconds of closing it.
Display its initial UI and perform initialization tasks.
RunningThe app is activated through a secondary tile or one of the activation contracts and extensions while it is running.Respond to the activation event as appropriate.
SuspendedThe app is activated through a secondary tile or one of the activation contracts and extensions while Windows is suspending it or after Windows has suspended it.Respond to the activation event as appropriate.
TerminatedWindows successfully suspends the app and then it is terminated. For example, Windows can terminate a suspended app if the system is running low on resources. Some apps, such as games, can be pretty resource intensive.Restore itself to the way the user left it, rather than starting fresh. Use data saved during app suspension. Refresh content or network connections that may have become stale.
ClosedByUserThe user closes the app through the close gesture or Alt+F4 and takes longer than 10 seconds to activate the app again.Display its initial UI and perform initialization tasks, rather than restoring its previous state.

On Windows Phone, only NotRunning and Suspended are supported.

Members

Member Value Description
ClosedByUserThe app was closed by the user.
NotRunningThe app is not running.
RunningThe app is running.
SuspendedThe app is suspended.
TerminatedThe app was terminated after being suspended.

Requirements

Namespace: Windows.ApplicationModel.Activation

Metadata: windows.winmd

See also

Reference

Windows.ApplicationModel.Activation Namespace