Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Icon property in the Window is crashing the application in Windows XP SP2

Suppose I have this:

<Window stuff Icon="Resources\myicon.ico">

If I run the program on Windows 7, it's fine. If I run it on Windows XP SP2, it crashes. Removing the Icon property, it works fine on Windows XP, but then it doesn't have my myicon on the Windows 7 taskbar or on the Window.

Also, setting the application icon on the VS project menu doesn't work for W7, but works for XP. In summary:

<Icon> = broken XP, ok W7
No <Icon> = ok XP, ugly W7
VS project icon option = doesn't work for W7, ok XP

For the record, I created icons for 16x16, 22x22, etc up till 256x256 for 32, 24 and 8 bits. I also used IcoFX auto option of creating the .ico image for Windows XP.

Is there a way around this? Or do I have to choose between an ugly Windows 7(and Vista?) App or no Windows XP app?

like image 814
zxcvbnm Avatar asked Feb 11 '10 23:02

zxcvbnm


2 Answers

XP does not support 256x256 icons. Remove the 256 icon for XP.

like image 129
tr4656 Avatar answered Nov 18 '22 13:11

tr4656


It has nothing to do with the resolution, but with the format: Windows XP can't handle PNG compressed icons in an ICO file. Normally only the bigger reolutions are compressed, mostly 256x256.
I used http://iconverticons.com/ to create ICO files and they also compress the 128x128 images using PNG.

To solve this, open your ICO file in Visual Studio and delete all versions of the icon in PNG format. Alternatively you can convert the PNG icons to BMP format with icoFx. Just disable compression in the options dialog and save your icon to a new file.
You can download IcoFx latest free version here: http://www.chip.de/downloads/IcoFX-letzte-Freeware-Version_28266149.html

like image 2
JCH2k Avatar answered Nov 18 '22 12:11

JCH2k