Is it possible to give AWT applications sharp taskbar icons in Windows 10 : <p>I'm trying to set the icon of a Java AWT application so it renders in native resolution on the Windows 10 taskbar (including when desktop scaling is set above 100%).  It seems that by default, if an executable embeds an icon containing multiple sizes, Windows seems to pick a size larger than the actual size of taskbar icons and downsize it (at 100% scale it resizes the 32 pixel icon to 24, <em>even if a 24 pixel icon is supplied</em>, and similarly for other scales.)</p>

<p>I've solved this problem for C++ MFC applications by loading just the correctly sized icon as a resource and sending a WM_SETICON message to the window, which results in a nice sharp icon on the taskbar and alt-tab dialog.</p>

<pre><code>smallIcon = (HICON)LoadImage( myInstance, MAKEINTRESOURCE(smallIconRes), IMAGE_ICON, smallIconSize, smallIconSize, LR_DEFAULTCOLOR );
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)smallIcon);

bigIcon   = (HICON)LoadImage( myInstance, MAKEINTRESOURCE(bigIconRes),   IMAGE_ICON, bigIconSize,   bigIconSize,   LR_DEFAULTCOLOR );
SendMessage(hWnd, WM_SETICON, ICON_BIG,   (LPARAM)bigIcon); 
</code></pre>

<p>That approach doesn't seem to work for Java applications - a WM_SETICON message with wParam set to ICON_SMALL works fine, but the equivalent with ICON_BIG is ignored.</p>

<p>If I try to use Java's API to set the icon, by doing this</p>

<pre><code>    List&lt;Image&gt; icons = new ArrayList&lt;Image&gt;();
    icons.add(windowIcons.getIcon(20)); // small icons are 20x20 pixels
    icons.add(windowIcons.getIcon(30)); // large are 30x30 at 125% scale
    setIconImages(icons);
</code></pre>

<p>the correct icon is used but it appears blurry, as if something has resized it to the "expected" size and then resized it back.  Left here is how it appears, right is the contents of the icon file.</p>

<p><a href="https://i.stack.imgur.com/45pv2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/45pv2.png" alt="Java application&#39;s icon vs. how it should look"></a></p>

<p>So, my question is: what can I do in this Java application to make Windows render the icon I give it on the taskbar without scaling it and blurring the details?</p>
