views:

67

answers:

1

I know the following things, and was wondering if they can be combined to make Java use jump-lists in Windows 7:

  1. Windows 7 displays Jump-Lists for supporting programs when a taskbar icon is right-clicked
  2. C++, C#, F#, and VB support this natively (as shown here)
  3. Java can import native capabilities using the JNA (as shown here)

Anybody have experience they can lend to help me create a jump-list for a Java app?

A: 

The word "natively" is overstating the case a bit. WPF provides jump list support. That's not the same as C# providing it. (For Windows Forms people there's the Code Pack which is a set of managed wrappers.) And MFC provides jump list support which is also not the same as C++ providing it. Anyway, there are two things going on here. One is adding files you opened recently to that jumplist, which under some circumstances you can get for free. The other is adding arbitrary files (typically starting point templates etc) to the jumplist.

To add a file to the recent/frequent list, you call SHAddToRecentDocs (http://msdn.microsoft.com/en-us/library/bb762105(VS.85).aspx), though you may not have to if, for example, you use the Common File Dialog control to open files, and/or the user double-clicks files to launch your app and open them (you have the file type registered.) Lots of folks suggest calling it anyway to be on the safe side. To add any old thing to the jumplist see http://msdn.microsoft.com/en-us/library/dd378402(v=VS.85).aspx.

How to call those from Java, I forget, but I hope they get you started.

Kate Gregory
Thanks for the help. It seems that the SWT does not have the exact method <code>SHAddToRecentDocs</code>. Is there any other way to do that?
Supuhstar
It's a Windows API function in Shell32.dll - so you want to use JNA or whatever the current "I need to call a native function of the underlying platform" mechanism is to call that function.
Kate Gregory