Ah yes, one can add resources this way in .NET, but that is not what I am
talking about. I am talking about adding an icon as a Win32 resource, not a
..NET resource. A Win32 resource is added to the header of the exe or dll
file in win32 format. This is what the /win32res and /win32icon switches on
the csc.exe (C#) and vbc.exe (VB.NET) compilers are for (see the MSDN help
for the command line compilers).
A Win32 icon is the icon that shows up for a file when viewed in Windows
Explorer. An exe or dll file can have multiple icons in this formar, which
can then be used by other Win32 applications. The resources added through
Visual Studio .NET that can be retrieved with GetManifestResourceStream are
in a new .NET-specific format that can only be retrieved by other .NET
applications, not by Win32 applications.
"Carlos J. Quintero [.NET MVP]" <carlosq@NOSPAMsogecable.com> wrote in
message news:%23nwAVhXfFHA.1248@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view] > What do you mean by multiple icons?
>
> The exe has an associated icon file (with maybe different images 16x16,
> 32x32 and colors) which is used by the Windows Explorer. You can set this
> icon in the properties window of the project.
>
> Apart from that icon, you can "embed" many icons in your exe to be used by
> your code. You add each icon file to the project, and in the properties
> window for that file selected you change the property "Build Action" to
> "Embedded Resource". At runtime you use GetManifestResourceStream function
> to retrive it. You can also use an ImageList control to store your images.
>
> --
> Best regards,
>
> Carlos J. Quintero
>
> MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
> You can code, design and document much faster.
> Free resources for add-in developers:
>
http://www.mztools.com >
> "Riko Eksteen" <riko_eksteen@hotmail.com> escribió en el mensaje
> news:%23wiGvUXfFHA.3616@TK2MSFTNGP12.phx.gbl...
>>I want to add multiple icons to my C# assembly (exe/dll). Visual Studio
>>.NET doesn't support this.
>>
>> It seems it can be done by using a Win32 .rc file which is compiled into
>> a .res file, and then linked into the assembly by using the /win32icon or
>> /win32res switch on the csc.exe or vbc.exe command line compiler.
>>
>> BUT there is no support for this in Visual Studio .NET. I have a large
>> Visual Studio project, and I cannot compile it from the command line
>> every time. Howcome VS.NET doesn't support this and how can I make it
>> work?
>>
>> Please, waiting for Visual Studio 2005 or using a C++ project to do it is
>> not a good enough answer for me. There has to be a way...
>>
>
>