User forums > General (but related to Code::Blocks)
a question about application resource
(1/1)
EricKane:
I want add in a .ico resouce for console application,has somebody can tell me how to do this?
or give me some information about syntax of .rc format files.
tiwag:
i assume, you want that your executable binary is shown with an icon in the windoze explorer
then it works with console projects the same way as with GUI projects, just edit a .rc file
for example: myconprj
myconprj.rc
--- Code: ---aaaaaaaa ICON "myconprj.ico"
--- End code ---
then add this file to your project.
when you are building your project, the resource compiler is atomatically invoked and creates a myconprj.res file,
which will be linked to your myconprj.exe file.
i used aaaaaaaa as iconname, because the icons are sorted alphabetically internally in the res file,
and if you use other icons too, this one will stay as the first icon which is found in the exe file and
this first one will be used to be displayed in the windoze explorer.
EricKane:
Thanks!
and I want to learn more about this,can you recommend some books for me?
Guest:
Try using a free Resource Editor like ResEd from http://www.radasm.com/projects/projects.html. Then look at the generated .rc files and you will learn enough. If you want a reference, you should go to the MSDN and download the Platform SDK or use it online. You can find the Resource-Definition Statements here.
EricKane:
Great!! Thanks for help! :D
Navigation
[0] Message Index
Go to full version