title: Pinning a Java application using Launch4j to the Windows 7 taskbar
body: <p>I'm currently trying to pin a Java application to the Windows 7 taskbar. The application is launched with <a href="http://launch4j.sourceforge.net/" rel="nofollow noreferrer">Launch4j</a>. 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.</p>
  
  <p>I followed the instructions of the solutions to these two questions to solve the problem but it didn't help:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1834599/pinning-a-java-application-to-the-windows-7-taskbar">Pinning a Java application to the Windows 7 taskbar</a></li>
  <li><a href="https://stackoverflow.com/questions/1907735/using-jna-to-get-set-application-identifier">Using JNA to get/set application identifier</a></li>
  </ul>
  
  <p>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.</p>
  
  <p>I have created a small test application on Github which demonstrates the problem:</p>
  
  <p><a href="https://github.com/kayahr/launch4jtest" rel="nofollow noreferrer">https://github.com/kayahr/launch4jtest</a></p>
  
  <p>The application uses <a href="http://maven.apache.org/" rel="nofollow noreferrer">Maven</a> as build system. Simply run <code>mvn package</code> 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.</p>
  
  <p>So what's wrong with this application?</p>