User forums > Help
Program Icon
eks:
Just look into a .rc file generated by Devcpp (when you add an icon), you should see something like this :
--- Code: ---A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "MyIcon.ico"
--- End code ---
Copy-paste this line into a .rc file of your project (create one if needed) and change the filename.
It works fine with gcc, I did not try with other compilers.
yckx:
Sorry to dig up an old thread, but I was searching for an answer to a similar problem, and this seems like as good a place as any to document what I found, so others may benefit. I had several ICON definitions in my RC file, and I couldn't figure out how to tell Code::Blocks which one to use as the icon for Windows Explorer. This was my code:
--- Code: ---ID_ICON_KRAT_16 ICON "resource\\krat_16.ico"
ID_ICON_KRAT_32 ICON "resource\\krat_32.ico"
ID_ICON_KRAT_48 ICON "resource\\krat_48.ico"
--- End code ---
I tried re-ordering the lines, and sought for some option in Code::Blocks to let me choose which icon would be used. Turns out I was looking in the wrong place. In my resdefs.hpp file I had this:
--- Code: ---#define ID_ICON_KRAT_16 1000
#define ID_ICON_KRAT_32 1001
#define ID_ICON_KRAT_48 1002
--- End code ---
Well, I finally tried changing the defines, and learned that the resulting EXE uses the icon with the lowest-numbered ID for its icon in Windows Explorer. I don't know if this is standard Windows behavior or just how C::B/mingw defaults, but now that I've figured it out, I'm a happy man. And maybe somebody else can benefit from my extraordinarily inefficient use of time ;)
troels:
--- Quote from: yckx on August 31, 2006, 11:55:35 pm ---
--- Code: ---ID_ICON_KRAT_16 ICON "resource\\krat_16.ico"
ID_ICON_KRAT_32 ICON "resource\\krat_32.ico"
ID_ICON_KRAT_48 ICON "resource\\krat_48.ico"
--- End code ---
--- End quote ---
The idea is to bundle icons of different sizes into just one single 'compound' icon.
Windows will then pick one out of this 'compound' icon, the one that matches the best.
Navigation
[0] Message Index
[*] Previous page
Go to full version