Reputation: 6553
I've started adding JumpLists to my programs and know how to "talk back" using a single instance of my program, but I was wondering if it is possible to override the Pin functionality or otherwise add two commands to a single line?
I want to have an "Open location" (main click) or "Remove location" option, and was hoping to be able to override the Pin icon to act as the "remove".
I know I could do it by making twice as many items and having half of them as "remove" and half as "open", but it would really clean up the UI / List if they could be on a single line.
Upvotes: 0
Views: 598
Reputation: 3803
I don't believe this is possible. Looking at both the managed and unmanaged API's it's pretty clear that a JumpList is a collection of JumpItem and a JumpItem (or really, a JumpTask or JumpPath) can only take a single path with additional arguments. To override the JumpItem click handler you'd need access to methods that are not exposed by Windows.
Upvotes: 1
Reputation: 13063
I haven't worked with Win7 jumplists before, but is there an event you can catch if users "unpin" an item? If so, you could catch that event, do the necessary operations, and re-add the item to the jumplist... A bit of a workaround, but it'd do what you want.
Otherwise, just change the text and functionality of a list item once it's clicked (from "Open location" to "Remove location" if the user opened a location and vice versa). You could keep a boolean or something for each item to distinguish the current state.
Upvotes: 0