Program Icon

Everything else that doesn't fall into one of the other PB categories.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Program Icon

Post 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.
BERESHEIT
r_hyde
Enthusiast
Enthusiast
Posts: 155
Joined: Wed Jul 05, 2006 12:40 am

Post 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'.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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.
BERESHEIT
Post Reply