How do I set an icon for an executable?

  • Thread starter Thread starter Stephen Myers
  • Start date Start date
S

Stephen Myers

I have a Windows.Forms based application. I would like to set an icon which
can then be found by ExtractIconEx() in a separate application.

This is apearently different than the Form's icon property.

Thanks in advance,
Steve
 
I have a Windows.Forms based application. I would like to set an icon
which
can then be found by ExtractIconEx() in a separate application.

Look in the project properties. There's a place there where you can
specify the application icon.
 
Save the icon into a compiled Win32 resource file (*.res), and include that
in your project.

I think the C# compiler will do this for you with a maximum of one icon if
you follow Peter's instructions. If you need more than one (for instance to
differentiate documents with extensions associated to your software) you'll
have to go with .res, which also allows you to set the icon identifier
that's needed when setting file associations.
 
Ben said:
Save the icon into a compiled Win32 resource file (*.res), and include
that in your project.

I think the C# compiler will do this for you with a maximum of one icon
if you follow Peter's instructions. If you need more than one (for
instance to differentiate documents with extensions associated to your
software) you'll have to go with .res, which also allows you to set the
icon identifier that's needed when setting file associations.
I knew it had to be something easy.

Thanks for the help.
 
Back
Top