2
votes

I've made a VCL application in Delphi, and set the application icon using the Project/Options dialog. I also added additional icons to the application by adding an RC file to the project. None of these is named "MAINICON" in the RC file to avoid conflict with the application icon resource.

The EXE contains all icons: the application icon, and the additional icons listed in the RC file. When I start the EXE, both the main form and the taskbar button will display the application icon, as expected.

The problem is that file managers (Explorer, Total Commander etc.) display one of the additional icons for the exe. Why? Is it possible to make the application icon displayed in file managers?

Thanks!

1
Is it possible that you're experiencing Windows caching your icons? Have you ever used that icon any time in the past?Jerry Dodge
As a test, move the EXE to a folder it's never been to before, run it, and see if you still have the wrong icon.Jerry Dodge
@JerryDodge I've already cleared the windows icon cache. It didn't help.kol
@JerryDodge If I create a shortcut to the EXE, and I open the Properties/Change Icon dialog, it shows every icon. The one icon shown first in the list is the one shown by Explorer. The one I've added as the application icon comes later in the list. Is it possible that file managers choose the first embedded icon?kol

1 Answers

8
votes

AFAIK Windows selects the first icon resource, in alphabetical order. So rename your addidional icon resources so that they come after MAINICON in the alphabetical order. Rebuild and clear the icon cashe to see does it fix it.