Weird problem with icon in Explorer

Started by Wilko Verweij, June 27, 2017, 04:29:52 PM

Previous topic - Next topic

Wilko Verweij

Hi,
I have a weird problem with a program I am developing. Initially, I had one icon included in the resource file. Looks like this:IMAGE_CHEAQS ICON "IMAGES\\CHEAQS.ICO"

I use that icon to appear on the top left of my program window (loaded with LoadImage in the RegisterClassEx call). Works fine. Now I added two other icons in the resource file. Looks like this now:IMAGE_CHEAQS ICON "IMAGES\\CHEAQS.ICO"
ICON_INPUT ICON "IMAGES\\INPUT48.ICO"
ICON_OUTPUT ICON "IMAGES\\OUTPUT48.ICO"

I do not use the icons in the program itself, but use them in an utility program to associate input and output files with my main program. That works. However, in Windows Explorer, my main program now displays the second icon in this list while before the first one was displayed. I do not want that. How to change that?
What I already tried:

  • clear the icon cache by deleting iconcache.db
  • replace the first icon with a 64x64 copy (because the first icon originally is 32x32 and the second and third are 48x48; I thought maybe Windows selects a bigger one)
Any suggestions? I write this program with winfbe and freebasic.
Wilko

José Roca

Alphabetically, ICON_INPUT goes before IMAGE_CHEAQS. Either use numbers or use, for example, A_IMAGE_CHEAQS ICON "IMAGES\\CHEAQS.ICO".

Wilko Verweij

You are right (as ever...). It picks the first one from the alphabet...
Thanks again,
Wilko

Petrus Vorster

Cool, and i never bothered to ask here on the forum, assuming i did something stupid again...
Will definitely go look at my resource file tonight.
-Regards
Peter

Wilko Verweij

I assumed I did something stupid again too (and I did; I always thought the order in which resources are mentioned in the resource file was determining). But I keep asking. (Some) People here are real experts, and always friendly...

Petrus Vorster

If it wasn't for these guys on this forum I probably would have been stuck in VB 6 still making silly little programs. I still don't know half of what they know, but my hobby projects and office tools got seriously better to the extent that i could produce tools i never imagined i would do. (and made my work a whole lot easier!!!)
I owe them a lot. You too had helped a lot!! very thankful for everything.
-Regards
Peter