views:

260

answers:

0

We have come across some behaviour involving the taskbar icons that Windows 7 displays for different applications. I'm wondering whether anybody could shed some light on this:

  • Windows 7 is set with font-size = 110%.
  • Two MFC dialog applications A.exe and B.exe have exactly the same .ico resource embedded in them.
  • A.exe has a shortcut associated with it; B.exe does not.
  • Running A.exe shows a nice interpolated icon on the taskbar.
  • Running B.exe shows a different icon on the taskbar (not interpolated).

We would wish that the same icon appears on the taskbar for A.exe and B.exe - this is easily achieved by making a shortcut to B.exe to give the same behaviour. However, I'm really trying to understand more on what's going on.

In trying to understand what was going on I have handled the WM_GETICON message inside B.exe, returning an icon according to the sizes given by GetSystemMetrics SM_CXICON/SM_CYICON or SM_CXSMALLICON/SM_CYSMALLICON size. However, this didn't seem to affect the icon shown in the taskbar.

I also know that we could create an .ico file to be built into B.exe with lots of different sizes of icons - maybe this would improve things, but that's a tedious solution!

Any ideas?