changing icon

Aug 11, 2008 at 10:33am
After compiling .exe file , how to change it's icon?
Last edited on Aug 11, 2008 at 12:41pm
Aug 11, 2008 at 6:44pm
Aug 11, 2008 at 7:20pm
I don't think he meant that way.

Some applications let you change the icon for the app from within settings.

I was originally going to suggest looking into loadicon or loadimage routines, but this would only keep the icon while the program is running. Chances are, it uses some system calls to set the icon, much like you can do with shortcuts or folders when you right click and choose properties.
Aug 11, 2008 at 7:46pm
If you talk for console application, method with Resource Hacker will not help. :)

If you use Borland C++, step-by-step:

1) Open your project.
2) Go to View > Project Manger.
3) Find and delete file "projectname.rsc".
4) Open project folder, then create new text document containing:

1 ICON "icon.ico"

Of course, replace icon with you icon name and change your icon name.

5. Then save file with extension "filename.rc", and open again Borland, and add resource file from Project Manger (Project > Add to project).

If you use other compiler, proceed is so-so alike think...

Enjoy!

P.S.: Excuse me for my bad english, but he is not my native language... ;)
Last edited on Aug 11, 2008 at 7:49pm
Aug 11, 2008 at 9:00pm
On Windows, you can use an application called "windres" to change the icon of your application :)
Aug 11, 2008 at 10:07pm
ResHacker will work just fine for both windows and console applications. The only difference between the two, as far as representing them, is a single bit in the PE32 header. The program's main icon resource should be named MAINICON.

Windres is a GCC program to compile .rc files into .res files. Borland's is brcc32.

You can load any icon you want and display it at runtime, but it is impossible to directly modify your executable while it is running.

Can you describe exactly when and how you want your icon to change, and for what purpose?
Aug 11, 2008 at 11:21pm
After compiling .exe file , how to change it's icon?


I must be reading this completely wrong.. everyone who has replied has assumed he meant how to change it's icon permanently.. before shipping it out.

At which point.. just changing the icon in the resource file, and re-compiling should be more than enough to do the trick.

I for some reason thought he meant from within the program, kinda like how Winamp lets you select which icon you wish to use from a list of icons, in it's prefferences.

It must just be me.
Last edited on Aug 11, 2008 at 11:21pm
Aug 12, 2008 at 3:41am
You could be right on. The possibility had not even passed through my mind. Until he responds again we just won't know.
Aug 12, 2008 at 7:23am
I must be reading this completely wrong.. everyone who has replied has assumed he meant how to change it's icon permanently.. before shipping it out.

Yes , thats what I meant.
Aug 12, 2008 at 8:16am
ok.. then yea.. simply change the icon in the resource file and re-compile. the only object that should need re-compiling is the resource part, so it shouldn't be a very big compile time.
Topic archived. No new replies allowed.