tags:

views:

66

answers:

2

I have created a couple of WPF apps but when right clicking them in the Windows 7 Taskbar I just get a Close Windows Option, usually there is a Pin to Taskbar option, I don't know where this has gone, is there anything that needs to be enabled or anything.

I am using:

  • VS2010 + Blend 4 with .NET Framework 3.5SP1
+1  A: 

I think you need to make a research here http://code.msdn.microsoft.com/Windows7Taskbar

Umair Ashraf
+1 interesting, thanks for sharing
GenEric35
A: 

Your shortcut for the WPF Application requires an AppUserModelID. This is a property that can be set on any .lnk shortcut. Once Windows knows the AppUserModelID it provides the new features of the Taskbar to the app, including taskbar icon glomming which groups several open windows of the same app together. If you use MSI to install your apps you can use the MsiShortcutProperty table and set AppIDProperty for your app's shortcut. The value takes the following form:

For your MsiShortcutProperty table, add the following values to the table:

Columns/values:
MsiShortcutProperty/AppIDProperty
Shortcut_/MyShortcut.<guid>
PropertyKey/System.AppUserModel.ID
PropVariantValue/<YourCompanyName.ProductName.SubProduct.VersionInformation>

You can also look at the following article which explains how the ID is used and can be set on a shortcut programmatically: http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx#where

Risotto
Thanks, I found out the IsHostApp entry was in the registry, so I'll put your answer as the answer as the link you provided gave the needed information. Thanks again.
Sandeep Bansal