AppTaskInfo Class

Definition

Represents an app task that can be displayed in the Windows Shell.

public ref class AppTaskInfo sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Shell.Tasks.AppTaskContract, 65536)]
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppTaskInfo final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Shell.Tasks.AppTaskContract), 65536)]
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppTaskInfo
Public NotInheritable Class AppTaskInfo
Inheritance
Object Platform::Object IInspectable AppTaskInfo
Attributes

Windows requirements

Requirements Description
Device family
Windows Desktop Extension SDK (introduced in 10.0.26100.0)
API contract
Windows.UI.Shell.Tasks.AppTaskContract (introduced in v2.0)

Remarks

Important

App task support will start gradually rolling out to Windows 11 starting May, 2026. The experiences enabled by Windows.UI.Shell.Tasks APIs require that the corresponding app task feature be present in the version of Windows where the app runs. Otherwise, these APIs will not have any effect.

This class supports creating, updating, and removing task representations. Tasks are persisted across app sessions and system reboots.

For each task, create a new AppTaskInfo instance and modify it to represent the task state. When a task is no longer relevant, call Remove to remove it from the Shell.

Use IsSupported to check if the feature is available before attempting to create or enumerate tasks. Use FindAll to enumerate existing tasks that were created previously.

Tasks can be hidden by users through the taskbar interface. Hiding a task does not affect the task running in the app; its representation is simply removed from the taskbar. The HiddenByUser property indicates whether a task has been hidden by the user.

Using shell tasks APIs

Apps that use these APIs need to be packaged. See Packaging overview for more info.

You also need to add the com.microsoft.apptaskprovider AppExtension to your app manifest like this:

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  IgnorableNamespaces="rescap uap uap3">
...

<Application>
  ...
  <Extensions>
    <uap3:Extension Category="windows.appExtension">
        <uap3:AppExtension
            Name="com.microsoft.apptaskprovider"
            PublicFolder="Public"
            Id="MyApp.AppTaskProvider"
            DisplayName="AppTaskProvider for MyApp"/>
    </uap3:Extension>
  </Extensions>
  ...
</Application>

...
</Package>

Properties

Name Description
DeepLink

Gets a URI that will be launched when the user clicks on the task's Shell representation.

EndTime

Gets the time when this task reached an ending state (such as Completed or Error).

HiddenByUser

Gets a value that indicates whether the user has hidden this task through the Windows Shell.

IconUri

Gets the path to an icon that represents the task.

Id

Gets the automatically generated unique identifier for this task.

StartTime

Gets the time when this task was created.

State

Gets the current state of this task.

Subtitle

Gets the subtitle of this task.

Title

Gets the title of this task.

Methods

Name Description
Create(String, String, Uri, Uri, AppTaskContent)

Creates a new app task with the specified parameters.

FindAll()

Returns all app tasks that were created by the current application.

GetCompletedSteps()

Gets the sequence of steps that have been completed for this task.

GetExecutingStep()

Gets the step that is currently executing for this task.

IsSupported()

Gets a value that indicates whether the app task feature is supported on the current device.

Remove()

Removes this task from the Windows Shell, but doesn't change its state.

Update(AppTaskState, AppTaskContent)

Updates both the state and content of this task.

UpdateDeepLink(Uri)

Updates the deep link URI for this task.

UpdateState(AppTaskState)

Updates the state of this task without changing its content.

UpdateTitles(String, String)

Updates the title and subtitle of this task.

Applies to