Reputation: 149
Is there a way to create Windows Taskbar jumplists in a VB.NET Windows Form Application? I'd like to add my last opened files to the list.
I've done a bunch of searching and can find this: https://learn.microsoft.com/en-us/dotnet/api/system.windows.shell.jumplist?redirectedfrom=MSDN&view=net-5.0, but I can't figure out how to get System.Windows.Shell to be accessible in my application. It says the namespace can't be found.
Any direction you can point me would be appreciated!
Upvotes: 1
Views: 468
Reputation: 149
Here's what I got working:
Dim a As System.Windows.Application = System.Windows.Application.Current
If a Is Nothing Then a = New System.Windows.Application
Dim currJumpList As System.Windows.Shell.JumpList = JumpList.GetJumpList(a)
If currJumpList Is Nothing Then
currJumpList = New JumpList
JumpList.SetJumpList(a, currJumpList)
Else
currJumpList.JumpItems.Clear()
End If
Dim jumpTask As JumpTask
jumpTask = New JumpTask
jumpTask.Title = "This is what gets shown to the user"
jumpTask.Description = "This is what the user sees if they hover or the item"
jumpTask.ApplicationPath = "pathToYourEXE"
jumpTask.Arguments = "Your arguments"
jumpTask.CustomCategory = "The category header"
currJumpList.JumpItems.Add(jumpTask)
currJumpList.Apply()
Important Notes:
Upvotes: 2