1. <i id='B7q23'><tr id='B7q23'><dt id='B7q23'><q id='B7q23'><span id='B7q23'><b id='B7q23'><form id='B7q23'><ins id='B7q23'></ins><ul id='B7q23'></ul><sub id='B7q23'></sub></form><legend id='B7q23'></legend><bdo id='B7q23'><pre id='B7q23'><center id='B7q23'></center></pre></bdo></b><th id='B7q23'></th></span></q></dt></tr></i><div id='B7q23'><tfoot id='B7q23'></tfoot><dl id='B7q23'><fieldset id='B7q23'></fieldset></dl></div>
    2. <legend id='B7q23'><style id='B7q23'><dir id='B7q23'><q id='B7q23'></q></dir></style></legend>

      <small id='B7q23'></small><noframes id='B7q23'>

      <tfoot id='B7q23'></tfoot>

          <bdo id='B7q23'></bdo><ul id='B7q23'></ul>
      1. 使用 Launch4j 将 Java 应用程序固定到 Windows 7 任务栏

        时间:2024-08-25
      2. <i id='OVasN'><tr id='OVasN'><dt id='OVasN'><q id='OVasN'><span id='OVasN'><b id='OVasN'><form id='OVasN'><ins id='OVasN'></ins><ul id='OVasN'></ul><sub id='OVasN'></sub></form><legend id='OVasN'></legend><bdo id='OVasN'><pre id='OVasN'><center id='OVasN'></center></pre></bdo></b><th id='OVasN'></th></span></q></dt></tr></i><div id='OVasN'><tfoot id='OVasN'></tfoot><dl id='OVasN'><fieldset id='OVasN'></fieldset></dl></div>

        1. <tfoot id='OVasN'></tfoot>
              <tbody id='OVasN'></tbody>

            <legend id='OVasN'><style id='OVasN'><dir id='OVasN'><q id='OVasN'></q></dir></style></legend>

            • <small id='OVasN'></small><noframes id='OVasN'>

                  <bdo id='OVasN'></bdo><ul id='OVasN'></ul>
                • 本文介绍了使用 Launch4j 将 Java 应用程序固定到 Windows 7 任务栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在尝试将 Java 应用程序固定到 Windows 7 任务栏.该应用程序通过 Launch4j 启动.程序图标显示正确,但右键单击任务栏上的图标仅显示带有条目关闭窗口"的上下文菜单.没有用于将应用程序固定到任务栏的菜单项.将 EXE 文件拖入任务栏也无法正常工作.在任务栏中单击这个新启动器时,任务栏中会出现第二个图标.

                  I'm currently trying to pin a Java application to the Windows 7 taskbar. The application is launched with Launch4j. The program icon is displayed correctly but right-clicking the icon on the taskbar only shows a context-menu with the entry "Close window". No menu entry for pinning the application to the taskbar. Dragging the EXE file into the taskbar is also not working properly. When clicking this new launcher in the taskbar then a second icon spawns in the taskbar.

                  我按照这两个问题的解决方案的说明解决了问题,但没有帮助:

                  I followed the instructions of the solutions to these two questions to solve the problem but it didn't help:

                  • 将 Java 应用程序固定到 Windows 7 任务栏
                  • 使用 JNA 获取/设置应用标识符

                  第二个问题/解决方案中的 JNA 内容会编译并且不会引发任何异常.设置后我可以读取应用程序ID.但我仍然无法将应用程序固定到任务栏.

                  The JNA stuff from the second question/solution compiles and doesn't throw any exception. I can read the app id after setting it. But I still can't pin the application to the taskbar.

                  我在 Github 上创建了一个小型测试应用程序来演示该问题:

                  I have created a small test application on Github which demonstrates the problem:

                  https://github.com/kayahr/launch4jtest

                  应用程序使用 Maven 作为构建系统.只需运行mvn package,您会在目标目录中找到一个ZIP 文件,其中包含EXE 文件和设置此应用程序ID 所需的jna.jar.将此 ZIP 解压缩到某个目录,双击 EXE 并尝试将应用程序固定到任务栏,您会看到问题.

                  The application uses Maven as build system. Simply run mvn package and you'll find a ZIP file in the target directory which contains the EXE file and the jna.jar which is needed to set this app id. Extract this ZIP to some directory, double-click the EXE and try to pin the application to the taskbar and you'll see the problem.

                  那么这个应用程序有什么问题呢?

                  So what's wrong with this application?

                  推荐答案

                  N.B.应kayahr的要求重写了最初在主帖中的一些评论:)

                  N.B. Rewritten some comments originally in the main post as per kayahr's request :)

                  您需要创建一个嵌入AppUserModelID信息的图标快捷方式.InnoSetup 可以在 [Icons] 部分下创建这样的图标快捷方式.提供通过 JNA 分配给 AppUserModelID 的应用程序名称.推荐阅读链接:

                  You need to create an icon shortcut that embeds AppUserModelID information. InnoSetup can create such icon shortcut under [Icons] section. Supply the application name assigned to AppUserModelID via JNA. Suggested links to read:

                  如何为 izpack 安装程序制作 .exe 文件.jar 文件

                  Launch4j、NSIS 和复制固定的 Windows 7 任务栏图标

                  1. 它在将 EXE 文件(不是其图标快捷方式)拖放到 Windows 7 任务栏以创建固定图标时起作用;
                  2. 它在运行 EXE 文件并稍后选择固定到任务栏"选项菜单以创建固定图标时起作用.如果不设置AppUserModelID,这是不可能的;即使它会导致奇怪的行为,例如在任务栏上使用 javaw.exe 图标"而不是您的 exe 图标,因为 Launch4J 使用 javaw.exe 调用可执行 jar(重复的固定图标)
                  1. It works when dragging and dropping the EXE file (not its icon shortcut) into Windows 7 taskbar to create a pinned icon;
                  2. It works when running the EXE file and later choosing "pin to taskbar" option menu to create a pinned icon. If you don't set AppUserModelID, this is not possible; even it will cause a weird behavior like having javaw.exe "icon" on the taskbar instead of your exe icon since Launch4J calls the executable jar using javaw.exe (duplicated pinned icons)

                  要在 Linux 下运行基于 Windows 的安装程序生成器,请参考以下内容:

                  To run Windows-based installer builder under Linux, refer this as a guide:

                  http://katastrophos.net/andre/blog/2009/03/16/setting-up-the-inno-setup-compiler-on-debian/

                  是的,正如 kayahr 所说,此 Windows 7 功能仅在其嵌入 AppUserModelID 的图标快捷方式保持不变(即未移除/删除)时才有效.

                  Yes, as mentioned by kayahr, this Windows 7 feature will only work when its icon shortcut with embedded AppUserModelID remains intact (i.e. it is not removed/deleted).

                  这篇关于使用 Launch4j 将 Java 应用程序固定到 Windows 7 任务栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从 Java 的 processbuilder 执行的 ffmpeg 在 windows 7 下不返回 下一篇:Java 代表?

                  相关文章

                    • <bdo id='lDA70'></bdo><ul id='lDA70'></ul>
                  1. <legend id='lDA70'><style id='lDA70'><dir id='lDA70'><q id='lDA70'></q></dir></style></legend>
                  2. <small id='lDA70'></small><noframes id='lDA70'>

                      <i id='lDA70'><tr id='lDA70'><dt id='lDA70'><q id='lDA70'><span id='lDA70'><b id='lDA70'><form id='lDA70'><ins id='lDA70'></ins><ul id='lDA70'></ul><sub id='lDA70'></sub></form><legend id='lDA70'></legend><bdo id='lDA70'><pre id='lDA70'><center id='lDA70'></center></pre></bdo></b><th id='lDA70'></th></span></q></dt></tr></i><div id='lDA70'><tfoot id='lDA70'></tfoot><dl id='lDA70'><fieldset id='lDA70'></fieldset></dl></div>
                    1. <tfoot id='lDA70'></tfoot>