.Net获取最近打开的项目其他应用程序(如在菜单栏中)

时间:2016-01-19 06:31:05

标签: c# .net vb.net windows

它可以获取列表中的最近项目,如此图片?我如何从vb.net访问它?

列出最近的项目(右键单击图标栏)

http://i.stack.imgur.com/hnPtQ.png

由于

1 个答案:

答案 0 :(得分:0)

您所指的是跳转列表。您可以从.NET 4开始从.NET中进行访问。既然您想在VB.Net中使用它,请查看此article 和msdn上的official documentation

Imports System.Windows.Shell
Class Application

    Public Sub New()

        Dim jl As New JumpList
        JumpList.SetJumpList(Application.Current, jl)

        Dim SaveAs As New JumpTask
        SaveAs.ApplicationPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
        SaveAs.Title = "Save as..."
        SaveAs.Arguments = "-saveas"
        jl.JumpItems.Add(SaveAs)

        Dim Configuration As New JumpTask
        Configuration.ApplicationPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
        Configuration.Title = "Configuration"
        Configuration.CustomCategory = "Settings"
        Configuration.Arguments = "-config"
        jl.JumpItems.Add(Configuration)

        jl.Apply()

    End Sub

    Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup

        ' Handle "Save As" JumpList example
        If e.Args.Contains("-saveas") Then
            ' Fancy Code Funtime
            ' -- Remember, this launches as a new instance - if you don't want that, this end kills it when your done --
            End
        End If

        ' Handle "Configuration" JumpList example
        If e.Args.Contains("-config") Then
            ' I launch a configuration window here, really up to you
            ' -- Remember, this launches as a new instance - if you don't want that, this end kills it when your done --
            End
        End If

    End Sub

End Class