I needed to add some icons to my project as a resource (I cannot use TImageList in this case due to an error in TCoolTrayIcon, and I cannot quickly replace the component).
I created a .rc script icon to add two ico files to the Delphi resource file:
redicon ICON "c:\icon\red.ico" greenicon ICON "c:\icon\green.ico"
it compiles fine for icons.res, so I add it to the first block of my Delphi 7 project:
{$R icons.res}
then I save the handles in OnCreate () of the MainForm:
hRedIcon := LoadIcon(hInstance,'redicon'); hGreenIcon := LoadIcon(hInstance,'greenicon');
and then just use the descriptors.
Now, before the problem - after that, the project icon that was added to the project settings (size from 16x16 to 48x48) is replaced by the first icon (16x16 redicon), which I added to {$ R icons.res}.
How to prevent this? How to add additional icons to the project as a resource without replacing the icon added to Project Settings β Application β Download Icon?
Casady
source share