开发者

Is there a way to change the default EXE icon in Delphi

开发者 https://www.devze.com 2022-12-22 06:57 出处:网络
Embarcadero just released a whole bunch开发者_如何学JAVA of neat looking icons that I\'d like to use to make my Delphi 7 and 2009 apps look fancier. Is there a setting (or hack) in those IDEs that let

Embarcadero just released a whole bunch开发者_如何学JAVA of neat looking icons that I'd like to use to make my Delphi 7 and 2009 apps look fancier. Is there a setting (or hack) in those IDEs that lets me change the default exe icon?


You could always use a resource editor to find the icon in the Delphi ide or bpl and change it to something else. That would be permanent for all new projects.


Apart from the fact that Andrey answered exactly what you asked I assume you want to add more icons to your executable than just the one you can set in the project option? This can be done by adding a *.rc file to the project. The following line should go into your project:

{$R 'Icons.res' 'Icons.rc'}

The rc file is a plain text file that Delphi compiles into a res. To the rc file add 1 icon per line like this:

XIcon01 ICON ".\Images\ico\ADDRESS2.ico"
XIcon02 ICON ".\Images\ico\ADDRESS3.ico"
XIcon03 ICON ".\Images\ico\ADDRESS4.ico"

The first part is the name of the icon. I chose names that come after Mainicon alphabetically with Mainicon being the icon that you define in the project options. I'm not sure (maybe somebody can confirm?) but I think that Delphi compiles the first icon as the application icon so I made sure my additional icons sort later. In case you want to change the application's icon at runtime you can use the 2 Application.Icon.LoadFromResource routines. Hope that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号