Udostępnij za pośrednictwem


StartupTaskActivatedEventArgs Class

Definition

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

public ref class StartupTaskActivatedEventArgs sealed : IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StartupTaskActivatedEventArgs final : IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StartupTaskActivatedEventArgs : IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
Public NotInheritable Class StartupTaskActivatedEventArgs
Implements IActivatedEventArgsWithUser, IStartupTaskActivatedEventArgs
Inheritance
Object Platform::Object IInspectable StartupTaskActivatedEventArgs
Attributes
Implements

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

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

Gets the reason that this app is being activated.

PreviousExecutionState

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

SplashScreen

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

TaskId

Gets the unique identifier for your task.

User

Gets the user that the app was activated for.

Applies to

See also