views:

374

answers:

3

Embarcadero just released a whole bunch 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?

A: 

Project - Options - Application - Load Icon

Andrey
I'm not going to downvote this, but I wish you'd delete this answer. If I had to ask a question that received this answer I wouldn't be much of a programmer.
Peter Turner
all sorts of questions are asked here. i answered as i understood it.
Andrey
That's fine, thanks for not voting to close it as a dupe at least.
Peter Turner
+1  A: 

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.

Jeff Cuscutis
Yeah, do you know what that is? I searched for all the .res files and couldn't find anything. (using Delphi 7)
Peter Turner
use http://angusj.com/resourcehacker/ and edit the .exe directly.
glob
A: 

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

Joe Meyer