Hello,
I want to add more than one icon to my .net application. One icon for
application (as usual) and second icon should be visible as "document icon".
I thing it is not possible in VS.NET, but can I use assembly linker or
something else?

--
thanks and sorry my english ;-)
Matthew

Re: More app icons by Herfried

Herfried
Fri May 20 08:47:35 CDT 2005

"Mattehw" <Mattehw@discussions.microsoft.com> schrieb:
> I want to add more than one icon to my .net application. One icon for
> application (as usual) and second icon should be visible as "document
> icon".
> I thing it is not possible in VS.NET, but can I use assembly linker or
> something else?

You are right, that's not supported in the VS.NET IDE. However, you can
pass a Win32 resource file to the compiler when using the command-line
compiler.

<URL:http://dotnet.mvps.org/dotnet/samples/codingtechnique/ResourceIcons.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: More app icons by Joel

Joel
Fri May 20 09:04:10 CDT 2005

"=?Utf-8?B?TWF0dGVodw==?=" <Mattehw@discussions.microsoft.com> wrote in
news:9780A153-3397-4646-9A3C-9B9253C2F32C@microsoft.com:

> Hello,
> I want to add more than one icon to my .net application. One icon for
> application (as usual) and second icon should be visible as "document
> icon". I thing it is not possible in VS.NET, but can I use assembly
> linker or something else?
>

Isn't this controlled by the installer? If you make an installer project
for your app you can add file types to be registered and you can select an
icon either from an icon file or one embedded in the exe.

Although in the latter case I'm not 100% sure if you are able to select
from multiple icons embedded in the executable or if you are forced to use
the main application icon. I haven't tested this.

RE: More app icons by AMercer

AMercer
Fri May 20 09:25:38 CDT 2005

The way I do it is as follows.
1. Add the .ico files to your project (project, add existing item if memory
serves) and set the build action to "embedded resource". This will add the
icon to your exe.
2. To set a form's icon (MyFrom below) using an embedded resource, follow
this fragment

Dim sra As Reflection.Assembly
Dim str As IO.Stream
Dim s As String
s = "xxx.yyy.ico" ' xxx is your app name, yyy is your icon name
sra = Reflection.Assembly.GetExecutingAssembly
str = sra.GetManifestResourceStream(s)
MyForm.Icon = New Drawing.Icon(str)

MS documentation hints at how to access embedded resources directly without
using streams. I tried, failed, gave up, and continue to use streams.

"Mattehw" wrote:

> Hello,
> I want to add more than one icon to my .net application. One icon for
> application (as usual) and second icon should be visible as "document icon".
> I thing it is not possible in VS.NET, but can I use assembly linker or
> something else?
>
> --
> thanks and sorry my english ;-)
> Matthew

Re: More app icons by Joel

Joel
Fri May 20 14:06:37 CDT 2005

Joel Moore <asdadsasd@asdaadad.com> wrote in
news:Xns965C6642F2F10asdsadfgasdgadsa@207.46.248.16:

> "=?Utf-8?B?TWF0dGVodw==?=" <Mattehw@discussions.microsoft.com> wrote
> in news:9780A153-3397-4646-9A3C-9B9253C2F32C@microsoft.com:
>
>> Hello,
>> I want to add more than one icon to my .net application. One icon for
>> application (as usual) and second icon should be visible as "document
>> icon". I thing it is not possible in VS.NET, but can I use assembly
>> linker or something else?
>>
>
> Isn't this controlled by the installer? If you make an installer
> project for your app you can add file types to be registered and you
> can select an icon either from an icon file or one embedded in the
> exe.
>
> Although in the latter case I'm not 100% sure if you are able to
> select from multiple icons embedded in the executable or if you are
> forced to use the main application icon. I haven't tested this.

After reading the other reply to your post I'm wondering if I was
confused about what you're trying to do. I assumed you wanted to add a
file type to Windows that's associated with your application so that it
shows up in Windows Explorer with an icon you specify (like MP3 files and
Word documents). If so then that's something you do with an installer
project, not the main application project (other than maybe embedding the
icon in your executable and handling the file association actions).

If you just want to show icons somewhere inside your application (like in
a ListView control) then there are numerous ways to achieve that with
.NET and the MSDN docs are full of examples.

Re: More app icons by Mattehw

Mattehw
Mon May 23 12:11:00 CDT 2005

Thanks Herfried. This is I found.
Unfortunately my application is full of resources and it is not easy prepare
build script as batch, so I try use this hint in nANT
--
thanks and sorry my english ;-)
Matthew


"Herfried K. Wagner [MVP]" wrote:

> "Mattehw" <Mattehw@discussions.microsoft.com> schrieb:
> > I want to add more than one icon to my .net application. One icon for
> > application (as usual) and second icon should be visible as "document
> > icon".
> > I thing it is not possible in VS.NET, but can I use assembly linker or
> > something else?
>
> You are right, that's not supported in the VS.NET IDE. However, you can
> pass a Win32 resource file to the compiler when using the command-line
> compiler.
>
> <URL:http://dotnet.mvps.org/dotnet/samples/codingtechnique/ResourceIcons.zip>
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>
>