共用方式為


StartupTaskActivatedEventArgs 類別

定義

提供在裝置啟動時啟動應用程式或使用者登入時的資訊。

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
繼承
Object Platform::Object IInspectable StartupTaskActivatedEventArgs
屬性
實作

Windows 需求

裝置系列
Windows 10 Fall Creators Update (已於 10.0.16299.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v5.0 引進)

範例

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;
    }
}

備註

只有在 Windows Desktop 上才支援此功能。

屬性

Kind

取得啟動此應用程式的原因。

PreviousExecutionState

取得應用程式啟動前的執行狀態。

SplashScreen

取得 SplashScreen 物件,提供從啟動顯示畫面轉換至啟動應用程式的相關資訊。

TaskId

取得工作的唯一識別碼。

User

取得啟動應用程式的使用者。

適用於

另請參閱