<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx</link><description>You load the image directly.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10357417</link><pubDate>Mon, 08 Oct 2012 16:59:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10357417</guid><dc:creator>Clipboarder Gadget</dc:creator><description>&lt;p&gt;No the programs are DPI-aware.&lt;/p&gt;
&lt;p&gt;Even if you take a simple program from Petzolds samples with an icon and make it DPI-aware, Windows will take the 16-sized icon and scale it up even though there is a 32-sized icon.&lt;/p&gt;
&lt;p&gt;You can prevent this by calling LoadIconWithScaleDown or ExtractIconEx instead of LoadIcon but most programs don&amp;#39;t seem to do that.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10357417" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10357358</link><pubDate>Mon, 08 Oct 2012 14:10:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10357358</guid><dc:creator>JamesJohnston</dc:creator><description>&lt;p&gt;@Clipboarder Gadget: &amp;nbsp;Maybe the offending apps/icons are not DPI-aware? &amp;nbsp;If the app hasn&amp;#39;t declared itself DPI-aware in the manifest, Windows Vista/7 will emulate 96 DPI which might explain your behavior.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10357358" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10357343</link><pubDate>Mon, 08 Oct 2012 13:30:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10357343</guid><dc:creator>Lockwood</dc:creator><description>&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/b/oldnewthing/archive/2010/05/05/10007461.aspx"&gt;blogs.msdn.com/.../10007461.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Loadicon also sounds like a Transformer.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10357343" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10357270</link><pubDate>Mon, 08 Oct 2012 08:28:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10357270</guid><dc:creator>Giulia Q</dc:creator><description>&lt;p&gt;Shouldn&amp;#39;t pointers to resource data be decorated with const and __unaligned?&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;Resource data is &lt;a href="http://blogs.msdn.com/b/oldnewthing/archive/2011/06/09/10172702.aspx"&gt;4-byte aligned&lt;/a&gt;, so you don&amp;#39;t need to say __unaligned unless you have data that requires stricter alignment. You can say const if you want. That wasn&amp;#39;t really the point of the article. -Raymond&lt;/i&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10357270" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10357177</link><pubDate>Mon, 08 Oct 2012 00:33:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10357177</guid><dc:creator>640k</dc:creator><description>&lt;p&gt;[It&amp;#39;s a surprise if you aren&amp;#39;t the one who compiled the binary. LoadImage(&amp;quot;Notepad.exe&amp;quot;, 16, 16)...]&lt;/p&gt;
&lt;p&gt;Load&amp;shy;Icon isn&amp;#39;t LoadImage. If you don&amp;#39;t specify a size (i.e. Load&amp;shy;Icon), then it&amp;#39;s a surprise that the whole icon, including all it&amp;#39;s resolutions, isn&amp;#39;t loaded.&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;Load&amp;shy;Icon loads the icon at standard size (typically 32x32). I can&amp;#39;t wait for Alex to say &amp;quot;designed without adult supervision.&amp;quot; -Raymond&lt;/i&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10357177" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10356933</link><pubDate>Sat, 06 Oct 2012 11:03:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10356933</guid><dc:creator>Clipboarder Gadget</dc:creator><description>&lt;p&gt;Sadly it seems that the LoadIcon algorithm is broken since Vista. On a 150% scale DPI setting it loads always the lower resolution and never the higher. Because of that almost all application icons look blurry on the taskbar if you disable &amp;quot;Always combine&amp;quot; for the taskbar. Only some MS applications dont seem to do that, but only because they provide icons in all kinds of sizes.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356933" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10356930</link><pubDate>Sat, 06 Oct 2012 10:24:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10356930</guid><dc:creator>Klimax</dc:creator><description>&lt;p&gt;Just a reminder that LoadIcon and co are from time, where RAM saving had high prioirty.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356930" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10356923</link><pubDate>Sat, 06 Oct 2012 09:15:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10356923</guid><dc:creator>AndyCadley</dc:creator><description>&lt;p&gt;@640K: If you always load *all* versions of an icon, there&amp;#39;s of course no surprise that it uses lots more ram than if you only load what was actually needed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356923" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10356917</link><pubDate>Sat, 06 Oct 2012 08:16:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10356917</guid><dc:creator>640k</dc:creator><description>&lt;p&gt;If a 0.25mb ico file is compiled into the binary, there&amp;#39;s of course no surprise that it will use 0.25 of ram when loading it.&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;It&amp;#39;s a surprise if you aren&amp;#39;t the one who compiled the binary. LoadImage(&amp;quot;Notepad.exe&amp;quot;, 16, 16) suddenly requires 25x more memory than it used to. A folder in small icon mode would not be able to show more than 4000 files in a directory before running out of memory *just for the icons*. -Raymond&lt;/i&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356917" width="1" height="1"&gt;</description></item><item><title>re: How do I override the default icon selection algorithm?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2012/10/05/10356084.aspx#10356876</link><pubDate>Sat, 06 Oct 2012 02:13:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10356876</guid><dc:creator>640k</dc:creator><description>&lt;p&gt;Load&amp;shy;Icon should have loaded all icons, and DrawIcon/DrawIconEx should have decided which resolution to use. The current architectural choices makes me cringe!&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;&amp;quot;Why does my 16x16 icon take up a quarter megabyte of memory?&amp;quot; -Raymond&lt;/i&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10356876" width="1" height="1"&gt;</description></item></channel></rss>