User forums > General (but related to Code::Blocks)

Changing executable's icon

(1/3) > >>

Maciek:
The title pretty much describes what I'd like to know. How do I change the icon of my .exe file? It must be something I'm just missing, but I can't find a way to do this.

rickg22:
You need to add an icon as a resource, and on startup, set the icon using the appropriate function. Check the code::Blocks source to see how we do this for codeblocks.exe

Maciek:
I was thinking about something that is in project options in dev-cpp. I want to change the way the file looks in the explorer before running it.

Urxae:
The first icon in your resource file will be used as the icon of the executable. You'll have to create your resource file manually though, AFAIK Code::Blocks does not have a dialog for it like Dev-cpp. It's not extremely hard, just put something like this in it:

--- Code: ---MY_ICON ICON "my_icon.ico"
--- End code ---
The first word is the name of the icon (not important unless you want to refer to it in your code), the second word indicates it's an icon and then comes the name of the file to use.

Maciek:
OK, thanks a lot.
EDIT: Yep, already done it. Thanks again for your quick answer.

Navigation

[0] Message Index

[#] Next page

Go to full version