Setting EXE icon in Delphi 7

后端 未结 3 2286
攒了一身酷
攒了一身酷 2021-02-20 16:50

I\'m trying to customize the icon that shows in Windows Explorer and in Desktop shortcuts for my Delphi application.

In the Delphi 7 IDE, I have loaded the desired icon

相关标签:
3条回答
  • 2021-02-20 17:25

    Maybe the icon cache needs to be deleted. There are many pages about this problem, this link might be useful: http://smallvoid.com/article/windows-icon-cache.html

    0 讨论(0)
  • 2021-02-20 17:29

    I found it after more hunting. I created a new project by copying an existing project from another folder. I forgot to change the program name at the top of the DPR file to match the name of the new project. Somehow, if a wrong name is used there, it prevents the icon from being changed in the generated EXE file...

    0 讨论(0)
  • 2021-02-20 17:30

    When you assign an icon to an application, the icon will be embedded in a .res file named identical to the program name (the name mentioned in the first line of the .dpr file). When you change the program name in the .dpr file, delphi creates a new .res file with the new program name and looks for the icon resource in the new res file and finds none, and hence uses the default icon (or a rectangular white box). The old res file which carries the icon resource will no longer be used. In summary, if you change the program name, you will have to re-assign the icon.

    0 讨论(0)
提交回复
热议问题