Win 7 固定到任务栏 + launch4j + NSIS

Win 7 pin to task bar + launch4j + NSIS

我们努力使名为 JabRef (http://jabref.sourceforge.net/) 的 Java Swing 应用程序可固定到 Windows 的任务栏。到目前为止我们做了什么:

知道如何进一步调试吗?

这显示了右键单击菜单。

如果固定的快捷方式不是 "taken over" 当您 运行 应用程序时,则 AppModelUserIDs 设置不正确。

您可以使用 this tool (shellproperty.exe read "System.AppUserModel.ID" from "%appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\MyApp.lnk")

验证 .lnk 中的 ID

在 运行ning 应用程序中,可以根据 window and/or 进程设置 AppModelUserID。查询这些对于外部应用程序有点困难,但您可以使用 GetCurrentProcessExplicitAppUserModelIDSHGetPropertyStoreForWindow.

自行调用它们

如果 Windows 认为您的应用程序是托管应用程序,那么它将隐藏图钉菜单项,请参阅 Registering an Application as a Host Process. It looks like Java 应用程序已注册为主机进程。

If either the process itself or the shortcut file used to launch the process has an explicit AppUserModelID, then the host process list is ignored and the application is treated as a normal application by the taskbar. The application's running windows are grouped together under a single taskbar button and the application can be pinned to the taskbar.

我唯一的建议是在您的启动器应用程序(如果它是一个单独的进程)和由 javaw.exe 托管的主应用程序中使用 JNA/JNI 来调用 SetCurrentProcessExplicitAppUserModelID