Page 1 of 1

Program Icon

Posted: Tue Jan 16, 2007 4:39 am
by netmaestro
I made an interesting discovery today. Perhaps it's a bug, not sure. You can specify an Icon for your program to use in the Compiler Options, right? Specify an icon in there and it works. But what I found out today (the hard way) is that if your program is using a resource file and that resource file has an icon resource called "IconAbout" or anything with the word 'About' in it at all, that icon will be used for your program, regardless of what you specified in the Compiler options. In fact, if you didn't specify an icon at all in the Compiler options it'll use it. So what I had to do for my program was rename the 'IconAbout' to something else and add my program icon to the list calling it 'About'. Then it started using it again.

Posted: Tue Jan 16, 2007 4:58 am
by r_hyde
IIRC, the PE format will default to using the first icon resource it finds (packed in the executable) as its Explorer and titlebar icon. I guess you could call it a 'feature'.

Posted: Tue Jan 16, 2007 5:05 am
by netmaestro
If you have a resource file with 7 icons in it and one has 'About' in the name, it seems to get used regardless of where it comes in the list. I changed the name of four different icons to 'IconAbout' and each time whichever icon had that name got used, wherever it was.