Icons in the exe file

A

Ashutosh

Hi,
I am trying to include icons in my .net exe so that I can select those icons
for the shell, like setting the icons of shortcuts, icons for some file
types, etc...

I tried to include the icons in the Resource files, with different
'Persistance' propery set, added icons directly to the solutions with
different 'Build Action' property set.

But the only icon that appears when I try to select an icon through the
windows explorer is the one that I selected for the application from the
project properties.

Please advice.

Regards,
Ashutosh
 
N

Nicholas Paldino [.NET/C# MVP]

Ashutosh,

You have to place the icons in a Win32 resource file (you create it with
the Resource Compiler). You then have to modify the CSPROJ file to include
the /win32res flag on the CSC task to point to your Win32 resource file
(through the Win32Resource attribute) or you can manually compile your
project on the command line and use this flag.

If you want to specify an icon for your assembly, then you have to use
the /win32icon switch, and point to a icon file.

The documentation for CSC (the executable and task in MSBUILD) has more
information.
 
B

BlackWasp

Also, if you open the executable in the Visual Studio environment you can
add icons. I have tested this in VS2003 (the version I have on this PC).
Not sure about newer versions.

--

BlackWasp
www.blackwasp.co.uk


Nicholas Paldino said:
Ashutosh,

You have to place the icons in a Win32 resource file (you create it
with the Resource Compiler). You then have to modify the CSPROJ file to
include the /win32res flag on the CSC task to point to your Win32 resource
file (through the Win32Resource attribute) or you can manually compile
your project on the command line and use this flag.

If you want to specify an icon for your assembly, then you have to use
the /win32icon switch, and point to a icon file.

The documentation for CSC (the executable and task in MSBUILD) has more
information.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ashutosh said:
Hi,
I am trying to include icons in my .net exe so that I can select those
icons for the shell, like setting the icons of shortcuts, icons for some
file types, etc...

I tried to include the icons in the Resource files, with different
'Persistance' propery set, added icons directly to the solutions with
different 'Build Action' property set.

But the only icon that appears when I try to select an icon through the
windows explorer is the one that I selected for the application from the
project properties.

Please advice.

Regards,
Ashutosh
 
T

Todd Carnes

BlackWasp said:
Also, if you open the executable in the Visual Studio environment you can
add icons. I have tested this in VS2003 (the version I have on this PC).
Not sure about newer versions.


Can you explain a little what it is that you mean? Are you saying to add the
executable to a project?

Todd
 
A

Ashutosh

Hi Black Wasp,
I was able to open the file, but I think you can add only icons with 16bit
colur depth with that editor....not 32 bit as I was trying.

Cheers,
Ashutosh


BlackWasp said:
Also, if you open the executable in the Visual Studio environment you can
add icons. I have tested this in VS2003 (the version I have on this PC).
Not sure about newer versions.

--

BlackWasp
www.blackwasp.co.uk


Nicholas Paldino said:
Ashutosh,

You have to place the icons in a Win32 resource file (you create it
with the Resource Compiler). You then have to modify the CSPROJ file to
include the /win32res flag on the CSC task to point to your Win32
resource file (through the Win32Resource attribute) or you can manually
compile your project on the command line and use this flag.

If you want to specify an icon for your assembly, then you have to use
the /win32icon switch, and point to a icon file.

The documentation for CSC (the executable and task in MSBUILD) has
more information.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ashutosh said:
Hi,
I am trying to include icons in my .net exe so that I can select those
icons for the shell, like setting the icons of shortcuts, icons for some
file types, etc...

I tried to include the icons in the Resource files, with different
'Persistance' propery set, added icons directly to the solutions with
different 'Build Action' property set.

But the only icon that appears when I try to select an icon through the
windows explorer is the one that I selected for the application from the
project properties.

Please advice.

Regards,
Ashutosh
 
B

BlackWasp

Hi Todd,

no, if you just open up VS2003 then use the Open File command to open the
EXE you will be able to modify and add icons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top