Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Application icon to Window

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 12-25-2006   #1 (permalink)
Jan Kucera
Guest


 

Application icon to Window

Hi,
I have set up an application icon in the project properties. Now, how can I
use it in the application window?

Thanks,
Jan


My System SpecsSystem Spec
Old 12-25-2006   #2 (permalink)
Jan Kucera
Guest


 

Re: Application icon to Window

In MSDN, there is written:
-------------------------------
Windows Presentation Foundation (WPF) standalone applications have two types
of icons:
- One assembly icon, which is specified by using the <ApplicationIcon>
property in the application's project build file. This icon is used as the
desktop icon for an assembly.
- One icon per window that is specified by setting Icon. For each window,
this icon is used in its title bar, its task bar button, and in its ALT-TAB
application selection list entry.
A WPF window always displays an icon. When one is not provided by setting
Icon, WPF chooses an icon to display based on the following rules:
- Use the assembly icon, if specified.
- If the assembly icon is not specified, use the default Microsoft Windows
icon.
--------------------------------
I checked project file, and there is
<ApplicationIcon>Resources\Icon.ico</ApplicationIcon>

However, the window still uses the default icon....


"Jan Kucera" <kucera@lupacovka.cz> wrote in message
news:8D7AA8FF-1968-4191-BEEA-4096A2036F05@microsoft.com...
> Hi,
> I have set up an application icon in the project properties. Now, how can
> I use it in the application window?
>
> Thanks,
> Jan


My System SpecsSystem Spec
Old 12-25-2006   #3 (permalink)
Jan Kucera
Guest


 

Re: Application icon to Window

In MSDN, there is written:
-------------------------------
Windows Presentation Foundation (WPF) standalone applications have two types
of icons:
- One assembly icon, which is specified by using the <ApplicationIcon>
property in the application's project build file. This icon is used as the
desktop icon for an assembly.
- One icon per window that is specified by setting Icon. For each window,
this icon is used in its title bar, its task bar button, and in its ALT-TAB
application selection list entry.
A WPF window always displays an icon. When one is not provided by setting
Icon, WPF chooses an icon to display based on the following rules:
- Use the assembly icon, if specified.
- If the assembly icon is not specified, use the default Microsoft Windows
icon.
--------------------------------
I checked project file, and there is
<ApplicationIcon>Resources\Icon.ico</ApplicationIcon>

However, the window still uses the default icon....


"Jan Kucera" <kucera@lupacovka.cz> wrote in message
news:8D7AA8FF-1968-4191-BEEA-4096A2036F05@microsoft.com...
> Hi,
> I have set up an application icon in the project properties. Now, how can
> I use it in the application window?
>
> Thanks,
> Jan


My System SpecsSystem Spec
Old 12-26-2006   #4 (permalink)
Laurent Bugnion
Guest


 

Re: Application icon to Window

Hi,

Jan Kucera wrote:
> Hi,
> I have set up an application icon in the project properties. Now, how
> can I use it in the application window?
>
> Thanks,
> Jan


You can use the following attribute in the Window tag:

<Window x:Class="..."
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="GalaSoft.ico">

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
My System SpecsSystem Spec
Old 12-26-2006   #5 (permalink)
Laurent Bugnion
Guest


 

Re: Application icon to Window

Hi,

Jan Kucera wrote:
> Hi,
> I have set up an application icon in the project properties. Now, how
> can I use it in the application window?
>
> Thanks,
> Jan


You can use the following attribute in the Window tag:

<Window x:Class="..."
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="GalaSoft.ico">

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
My System SpecsSystem Spec
Old 12-27-2006   #6 (permalink)
Jan Kucera
Guest


 

Re: Application icon to Window

Hi, thanks for reply.
At first, this does not do the trick which is described in MSDN (using icon
defined in project properties if none is set to window), but what is worse,
this does not work to me. I have a file Resources\Icon.ico embedded as
ApplicationIcon resource in Properties\Resources.resx and I cannot manage to
display it. Simply <Window Icon="Resources\Icon.ico"> does not work, neither
"Resources/Icon.ico" does, nor "ApplicationIcon", all of these throws
exceptions. ("Cannot locate resource 'resources/icon.ico'.")

By the way, if I type absolute path to the icon in this attribute, it throws
"The image format is unrecognized." at runtime, but it normally compiles as
project icon. (The icon has 16x16 XP, 32x32 XP and 256x256 XP format).

Jan


"Laurent Bugnion" <galasoft-lb@bluewin.ch> wrote in message
news:%233YaVlPKHHA.4384@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> Jan Kucera wrote:
>> Hi,
>> I have set up an application icon in the project properties. Now, how can
>> I use it in the application window?
>>
>> Thanks,
>> Jan

>
> You can use the following attribute in the Window tag:
>
> <Window x:Class="..."
> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> Icon="GalaSoft.ico">
>
> HTH,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch


My System SpecsSystem Spec
Old 12-27-2006   #7 (permalink)
Jan Kucera
Guest


 

Re: Application icon to Window

Hi, thanks for reply.
At first, this does not do the trick which is described in MSDN (using icon
defined in project properties if none is set to window), but what is worse,
this does not work to me. I have a file Resources\Icon.ico embedded as
ApplicationIcon resource in Properties\Resources.resx and I cannot manage to
display it. Simply <Window Icon="Resources\Icon.ico"> does not work, neither
"Resources/Icon.ico" does, nor "ApplicationIcon", all of these throws
exceptions. ("Cannot locate resource 'resources/icon.ico'.")

By the way, if I type absolute path to the icon in this attribute, it throws
"The image format is unrecognized." at runtime, but it normally compiles as
project icon. (The icon has 16x16 XP, 32x32 XP and 256x256 XP format).

Jan


"Laurent Bugnion" <galasoft-lb@bluewin.ch> wrote in message
news:%233YaVlPKHHA.4384@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> Jan Kucera wrote:
>> Hi,
>> I have set up an application icon in the project properties. Now, how can
>> I use it in the application window?
>>
>> Thanks,
>> Jan

>
> You can use the following attribute in the Window tag:
>
> <Window x:Class="..."
> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> Icon="GalaSoft.ico">
>
> HTH,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch


My System SpecsSystem Spec
Old 12-28-2006   #8 (permalink)
Keith Patrick
Guest


 

Re: Application icon to Window

Have you tried it without the "Resources/" prefix? I'm wondering if the
subdirectory info is stripped out when the resource gets compiled & embedded
into the app. If not, another thing to try is the pack format:
"pack://application,,,/Resouces/Icon.ico"



My System SpecsSystem Spec
Old 12-28-2006   #9 (permalink)
Keith Patrick
Guest


 

Re: Application icon to Window

Have you tried it without the "Resources/" prefix? I'm wondering if the
subdirectory info is stripped out when the resource gets compiled & embedded
into the app. If not, another thing to try is the pack format:
"pack://application,,,/Resouces/Icon.ico"



My System SpecsSystem Spec
Old 12-29-2006   #10 (permalink)
Jan Kucera
Guest


 

Re: Application icon to Window

Hi,
Icon.ico fails inside Cider and both during run-time.
Pack format throws parser Exception whose InnerException is {"Exception has
been thrown by the target of an invocation."} so I don't see what the
problem is.

Though, this would not do the application -> window trick...
Thanks for try.

"Keith Patrick" <richard_keith_patrick@nospam.hotmail.com> wrote in message
news:O3fj0GmKHHA.420@TK2MSFTNGP06.phx.gbl...
> Have you tried it without the "Resources/" prefix? I'm wondering if the
> subdirectory info is stripped out when the resource gets compiled &
> embedded into the app. If not, another thing to try is the pack format:
> "pack://application,,,/Resouces/Icon.ico"
>
>
>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
getting application not found when double clicking on dvd drive icon Gordon Campbell Vista General 1 03-06-2008 08:49 AM
Application window moving up and down by itself Larry Vista General 4 01-20-2008 07:53 AM
Navigation Application in Window hufaunder@yahoo.com Avalon 4 04-11-2007 08:34 AM
Window Feedback Panel application DJ Bjorklund Vista General 0 06-22-2006 03:54 PM
Access to owning application from Window? Jason Dolinger Avalon 1 01-10-2006 03:54 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51