Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: zealkane on May 04, 2006, 11:24:10 am

Title: a question about application resource
Post by: zealkane on May 04, 2006, 11:24:10 am
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.
Title: Re: a question about application resource
Post by: tiwag on May 04, 2006, 11:37:22 am
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"

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.
Title: Re: a question about application resource
Post by: zealkane on May 04, 2006, 12:09:44 pm
Thanks!
and I want to learn more about this,can you recommend some books for me?
Title: Re: a question about application resource
Post by: Guest on May 04, 2006, 12:37:53 pm
Try using a free Resource Editor like ResEd (http://www.radasm.com/projects/ResEd.zip) from http://www.radasm.com/projects/projects.html (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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/resource_definition_statements.asp).
Title: Re: a question about application resource
Post by: zealkane on May 04, 2006, 01:30:52 pm
Great!! Thanks for help! :D