Share via


AppResourceGroupInfo.StartSuspendAsync Method

Definition

Initiate moving the associated app to the suspended state.

public:
 virtual IAsyncOperation<AppExecutionStateChangeResult ^> ^ StartSuspendAsync() = StartSuspendAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<AppExecutionStateChangeResult> StartSuspendAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<AppExecutionStateChangeResult> StartSuspendAsync();
function startSuspendAsync()
Public Function StartSuspendAsync () As IAsyncOperation(Of AppExecutionStateChangeResult)

Returns

The result of trying to suspend the app.

Attributes

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)
App capabilities
appDiagnostics

Remarks

Calling this method on an app that is already suspended will return success.

This method initiates the standard workflow to move the app to the Suspended state. For example, on desktop this workflow includes minimizing the app. This will also include calling the app’s OnSuspending callback in the normal way, including honoring deferrals during suspension. This method will return as soon as it has initiated the suspension workflow, and not wait for the app to transition state or for it to run its OnSuspending method. Note that the app may take a long time to suspend, depending on deferrals.

You can call this method from any AppResourceGroupInfo, but only the one for the foreground app has a high probability of succeeding. Suspending the foreground app may result in suspending other resource groups for that app.

This method won’t work on ResourceGroups that relate to background tasks because they don’t have the concept of suspend/resume.

This method won’t work on Desktop Bridge apps because they don’t have the concept of suspend/resume.

Applies to

See also