I needed to add some icons to my project as a resource (I can't use a TImageList in this case, because of a bug in TCoolTrayIcon, and I can't replace the component quickly).
I've created an icons.rc script to add the two ico files to a Delphi resource file:
redicon ICON "c:\icon\red.ico"
greenicon ICON "c:\icon\green.ico"
it compiles fine to icons.res, so I add it to the first unit of my Delphi 7 project:
{$R icons.res}
then I store the handles in OnCreate() of the MainForm:
hRedIcon := LoadIcon(hInstance,'redicon');
hGreenIcon := LoadIcon(hInstance,'greenicon');
and then use the handles just fine.
Now to the problem - after doing that the project icon that was added in the project options (in sizes of 16x16 to 48x48) is replaced by the first icon (16x16 redicon) I've added in {$R icons.res}.
How to prevent this? How to add additional icons to a project as a resource without replacing the icon that is added in Project Options -> Application -> Load Icon?