StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs StartupTaskActivatedEventArgs Class

Definition

Provides information when an app is activated at device startup or user login.

public : sealed class StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
struct winrt::Windows::ApplicationModel::Activation::StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
public sealed class StartupTaskActivatedEventArgs : IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
Public NotInheritable Class StartupTaskActivatedEventArgs Implements IActivatedEventArgs, IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

protected override void OnActivated(IActivatedEventArgs args)
{
    string argString = string.Empty;

    // Existing behavior to differentiate different activation kinds,
    // and to extract any argument payload.
    switch (args.Kind)
    {
        case ActivationKind.StartupTask:
            var startupArgs = args as StartupTaskActivatedEventArgs;
            string taskId = startupArgs.TaskId;
            break;
    }
}

Remarks

This functionality is only supported on Windows Desktop.

Properties

Kind Kind Kind Kind Kind

Gets the reason that this app is being activated.

PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState PreviousExecutionState

Gets the execution state of the app before it was activated.

SplashScreen SplashScreen SplashScreen SplashScreen SplashScreen

Gets a SplashScreen object that provides information about the transition from the splash screen to the activated app.

TaskId TaskId TaskId TaskId TaskId

Gets the unique identifier for your task.

User User User User User

Gets the user that the app was activated for.

See also