Author Topic: a question about application resource  (Read 6164 times)

EricKane

  • Guest
a question about application resource
« 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.
« Last Edit: May 04, 2006, 11:31:51 am by EricKane »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: a question about application resource
« Reply #1 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.

EricKane

  • Guest
Re: a question about application resource
« Reply #2 on: May 04, 2006, 12:09:44 pm »
Thanks!
and I want to learn more about this,can you recommend some books for me?

Guest

  • Guest
Re: a question about application resource
« Reply #3 on: May 04, 2006, 12:37:53 pm »
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

  • Guest
Re: a question about application resource
« Reply #4 on: May 04, 2006, 01:30:52 pm »
Great!! Thanks for help! :D