AppResourceGroupInfo.StartSuspendAsync AppResourceGroupInfo.StartSuspendAsync AppResourceGroupInfo.StartSuspendAsync AppResourceGroupInfo.StartSuspendAsync AppResourceGroupInfo.StartSuspendAsync Method

Definition

Initiate moving the associated app to the suspended state.

public : IAsyncOperation<AppExecutionStateChangeResult> StartSuspendAsync()
IAsyncOperation<AppExecutionStateChangeResult> StartSuspendAsync() const;
public IAsyncOperation<AppExecutionStateChangeResult> StartSuspendAsync()
Public Function StartSuspendAsync() As IAsyncOperation(Of AppExecutionStateChangeResult)
Windows.System.AppResourceGroupInfo.startSuspendAsync().done( /* Your success and error handlers */ );

Returns

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)
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.

See also