Search code examples
delphiwindows-7iconsdelphi-2007

Best way to add icon to delphi 2007 app (win7)


I want to add icon to my delphi app. Icon was generated from image via ICOFX, including 128x128 and 256x256 (Vista) icons. I tried to add icon several times:

First of all, using Code Gear IDE: Project Options->Application->Icon. This was an easy way, but Vista-sized icons (128x128 and 256x256) were not added. When scaling in Windows Explorer Ctrl+Wheel, icon stoped increasing in size after 64x64. This happens because Delphi does not support big icons.

Then I tried to change icon in MyProject.RES file (using ResourseExplorer). It did not helped much.

When changing .exe-file icon using ResourseExplorer problems seems to be solved, but this is not a Path of a jedi, obviously. And some problems appears/remains, such as:

  1. when changing .exe-file name (ex: from MEPROG.EXE to _MYPROG.EXE), file icon is changing either (128x128 and 256x256 icons disappeare).
  2. when using MouseRightButton->Send to->Desktop to create a label, label's icon is of small resolution.
  3. copy-pasting exe-file into some other directory(not in deplhi project output dir), could also change icon.

Is there a better way to do this, or I am doing this wrong way?


Solution

  • See the change-log around 2.7 version

    http://andy.jgknet.de/blog/ide-tools/ide-fix-pack/

    it seems you just try to use Delphi without installing necessary fixes

    PS. another way might be to make some command-line utility replacing icon resource and then auto-call it after compilation phase. Still ugly, but better than manually launchign ResEdit each time.