用 Java 制作 Windows 任务栏跳转列表
I know the following things, and was wondering if they can be combined to make Java use jump-lists in Windows:
- Windows displays Jump-Lists for supporting programs when a taskbar icon is right-clicked
- C++, C#, F#, and VB support this natively (as shown here)
- 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?
The J7Goodies library won't work, as it no longer exists.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“本机”这个词有点夸大了情况。 WPF 提供跳转列表支持。这与 C# 提供的不同。 (对于 Windows 窗体用户,有 Code Pack,它是一组托管包装器。)MFC 提供跳转列表支持,这与 C++ 提供的支持不同。无论如何,这里发生了两件事。一种是将您最近打开的文件添加到该跳转列表中,在某些情况下您可以免费获得。另一种是将任意文件(通常是起点模板等)添加到跳转列表中。
要将文件添加到最近/频繁列表中,请调用 SHAddToRecentDocs,尽管您可能不必这样做,例如,您使用通用文件对话框控件打开文件,和/或用户双击文件来启动您的应用程序并打开它们(您的文件类型为已注册。)很多人建议为了安全起见无论如何都要调用它。要将任何旧内容添加到跳转列表,请参阅 http:// /msdn.microsoft.com/en-us/library/dd378402(v=VS.85).aspx。
我忘记了如何从 Java 中调用它们,但我希望它们可以帮助您入门。
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, 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.
有一个 Java 库为 Java 提供了新的 Windows 7 功能。它被称为 J7Goodies,由 Strix 代码。您可以用它创建自己的跳转列表。
There is a Java library providing the new Windows 7 features for Java. It's called J7Goodies by Strix Code. You can create your own jump lists with it.