Icon Resource Problem

  • Thread starter Thread starter Mark F.
  • Start date Start date
M

Mark F.

In Visual Studio 6 you were able to create a separate icon for the
application and the document type. The complied executable would then have
two separate icons in the file.

I have not been able to figure out how to do this with VS 2005 for a C#
Windows Form project. Any tutorials or info on this?

Mark
 
Mark,

You should be able to set the icon on the project properties page, and
that will be the icon for the executable.

If you want to have an icon in your executable which is used for file
associations, you will have to create a win 32 resource file, and then
compile it into your app. From the command line, you will compile your app
and then use the /win32res switch to attach the .res file to the executable.
Then, in your file association registry settings, you can point to your
executable and the resource id of the icon.
 
Mark said:
In Visual Studio 6 you were able to create a separate icon for the
application and the document type. The complied executable would then have
two separate icons in the file.

I have not been able to figure out how to do this with VS 2005 for a C#
Windows Form project. Any tutorials or info on this?

Are you using the Express Edition?

My recollection is that support for resource types is limited in
Express. In my version of VS 2005 Pro, I have no trouble creating as
many icon resources in the application as I like.

Even in Express, you should be able to add pre-existing icon files as
resources though. The limitation I recall has more to do with editing
them than in adding them.

The basic steps are easy: just double-click on the "Resources" item
under "Properties" in your project, and that will show the resource
editing UI. In there, you should be able to add new resources,
including icon files.

Pete
 
Hi mark,
Like a bitmap, an icon is used to display graphics on window objects. While
a bitmap can have any dimension the window needs, the size of an icon is
limited. This is because icons assume different roles on an application.

to create a sererated icon, please follow the below link, i hope it will
help you.

http://www.functionx.com/vcsharp/gdi/icons.htm

Regards,
Husam Al-A'araj
www.aaraj.net
 
Nicholas Paldino said:
Mark,

You should be able to set the icon on the project properties page, and
that will be the icon for the executable.

If you want to have an icon in your executable which is used for file
associations, you will have to create a win 32 resource file, and then
compile it into your app. From the command line, you will compile your
app and then use the /win32res switch to attach the .res file to the
executable. Then, in your file association registry settings, you can
point to your executable and the resource id of the icon.

Nicholas,

I created an .rc file then compiled it. Then included the .res file in my
project. With the DefaultIcon indexes set to 0 and 1 (app and document
respectively), the file icons are displayed correctly in Explorer.

Thanks for the help!
Mark
 
Back
Top