Windows 7 Taskbar .NET Sample Library – an Overview

One of the first noticeable changes in Windows 7 Desktop is the new Taskbar. The Windows 7 Taskbar post on the E7 blog clearly documents the reasons driving the Windows 7 Taskbar look and feel. The Windows 7 taskbar introduces new functionality that developers need to understand in order for them to take full advantage of it in their own applications and enhance their end users’ experiences. The Windows 7 Taskbar is an application-launching and window-switching mechanism that consolidates the functionalities from previous Windows Desktop mechanisms such as Quick Launch, Recent Documents, Notification area icons, desktop shortcuts, and running application windows.

If you are unfamiliar with and haven’t seen any demonstrations of the Windows 7 Taskbar, please watch the Windows 7 Taskbar Overview webcast on Channel 9. This will give you some context for the technical material we cover here.

This is the first post in a series of Taskbar posts. It provides an overview of both the new Taskbar functionality and the Taskbar and Libraries Sample .NET Interop Library, which is a managed code wrapper and part of the Windows 7 .NET Interop Sample Libraries.

Let’s review the Windows 7 Taskbar and Libraries .NET Interop Sample Library architecture and note the important classes. Opening the solution reveals the following structure:

  • A modified version of the Vista Bridge Sample Library - We based our code on the 1.4 version. And as mentioned before, the Windows Vista bridge Project will be superseded by the new Windows API Code Pack for the .NET Library
  • The Demos folder containing several demo projects that show the various aspects of both the Taskbar and Libraries wrappers as you can see from the image
  • The Wrappers folder containing the Windows7.DesktopIntegration assembly, which is the main manager API for both the Taskbar and Libraries
image

Let’s take a quick look at the main classes that enable developers to take advantage of the new taskbar functionality:

  • The Windows7Taskbar class provides low-level facilities for manipulating the process-wide and window-specific application IDs, controlling custom window preview bitmaps, setting the Taskbar overlay icon and progress bar, and clipping the Taskbar thumbnail
  • The JumpListManager class provides an abstraction of the application’s jump list, including facilities to manipulate custom destinations, user tasks, the Recent and Frequent lists, and items removed by the user
  • The ThumbButtonManager class provides an abstraction of the Taskbar thumbnail toolbar, including the facilities to create thumbnail toolbar buttons and receive notifications when they are clicked
  • The CustomWindowsManager class provides an abstraction of a customized window thumbnail preview and live preview (peek), including the facilities to receive a notification when a preview bitmap is requested by the Desktop Window Manager (DWM), and to automatically grab the preview bitmap of a window

The Taskbar demos showcase all of the above-mentioned Taskbar functionality. Let’s review them:

The MainDemo sample is a simple WinForm application that showcases all the functions that are expose via the API, including building a jump list with custom categories and custom tasks, setting an overlay icon and progress bar, and creating and handling events from Thumbnail Toolbar buttons:

image

In order for the main demo application to run properly, you will need to register this application as a registered handler for text files (*.txt). By registering this application and a handler for text files, you ensure that each time you open a text file directly from Windows Explorer. Windows automatically calls SHAddToRecentDocs on your application's behalf. This inserts the item in the Windows Recent list and eventually into the Jump List Recent Category. The same automatic behavior occurs when using the Windows common file dialog to open files through our applications.

You can register the application from the Administrative tool strip menu.

The DocumentReader sample demonstrates how developers can provide better Taskbar Thumbnail preview experiences for their users by clipping and customizing the Thumbnail Preview.

image

The IMClient sample demonstrates how Taskbar overlay icons and Taskbar progress bars can light up an application’s Taskbar button instead of relying on an additional dialog or on an icon in the system notification area (the tray). It is important to note that in Windows 7, the notification area has undergone a few changes and now shows the least number of icons in order to keep the taskbar clean and reduce the number of balloon notification messages.

image

The last demo, WebBrowser, demonstrates how to customize both the Thumbnail previews and the window preview (AeroPeek), and display internal tabs. As you can see from the following images, we can override the default behavior by flipping the images and adding some text on top of the preview image.

image

 

Here are some additional resources for programming the Windows 7 Taskbar:

Channel 9 videos:

Sasha Goldstein contributed to this blog - http://blogs.microsoft.co.il/blogs/sasha/archive/2009/02/12/windows-7-taskbar-apis.aspx


Comments

  1. Posted on: April 03, 2009 at 12:35PM  

    I already using that Library. I already port JumpListManager, IMClient icons, ProgressBar to VB 2008. Im currently working on the ThumbButtonManager, is like 80% done. I think tomorrow i post it on my blog

    If somebody wants to check http://sunco.codigoplus.com (is a Spanish blog)

  2. Posted on: April 03, 2009 at 4:52PM  

    Nice...I hate to go off-topic, but could someone please fix the link for the Library sample download? (it's still linking to the Taskbar sample)

  3. Posted on: April 03, 2009 at 5:57PM  

    The Windows Taskbar Sample includes the Libraries samples since they both part of the Shell. Therefore it points to the same download page. Which is titled as WIndows 7 Taskbar and Libraries Interop Library.

  4. Posted on: April 06, 2009 at 12:14PM  

    what happen to the tasks you'll perform most frequently for example, if I open the pictures folder to the top left like in windows xp there should be a number of tasks people perform most frequently. this feature should be brought to windows 7

  5. Posted on: September 01, 2009 at 1:05AM  

    windows 7 screenshots in this regard was beautiful vista, xp has left behind very good thank you blah blah

Trackbacks

  1. Posted by: Windows 7 Taskbar .NET Sample Library - Review on April 03, 2009 at 2:52AM

    Pingback from  Windows 7 Taskbar .NET Sample Library - Review

  2. Posted by: Dew Drop - April 3, 2009 | Alvin Ashcraft's Morning Dew on April 03, 2009 at 7:41AM

    Pingback from  Dew Drop - April 3, 2009 | Alvin Ashcraft's Morning Dew

  3. Posted by: Windows 7 Taskbar .NET Sample Library ??? an Overview|Join Our Story!|AngNetwork Blog on April 03, 2009 at 4:35PM

    Pingback from  Windows 7 Taskbar .NET Sample Library ??? an Overview|Join Our Story!|AngNetwork Blog

  4. Posted by: Tech News, Resources from Blogosphere - 04 April 09(7) | Best Webhosting on April 03, 2009 at 10:37PM

    Pingback from  Tech News, Resources from Blogosphere - 04 April 09(7) | Best Webhosting

  5. Posted by: DotNetShoutout on April 04, 2009 at 3:28AM

    Thank you for submitting this cool story - Trackback from DotNetShoutout

  6. Posted by: shooter's me2DAY on April 05, 2009 at 8:30AM

    Windows 7 Taskbar .NET Sample Library – an Overview

  7. Posted by: Internet Marketing Email » Blog Archive » Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 ... on April 05, 2009 at 9:01AM

    Pingback from  Internet Marketing Email  » Blog Archive   » Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 ...

  8. Posted by: Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 … | networking-the.info on April 05, 2009 at 11:19AM

    Pingback from  Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 … | networking-the.info

  9. Posted by: This Week on C9: Charles Torre on camera, C9 turns 5, and lots of freebies | CHARGED's Digital Lifestyle at Work or Play on April 10, 2009 at 9:37PM

    Pingback from  This Week on C9: Charles Torre on camera, C9 turns 5, and lots of freebies | CHARGED's Digital Lifestyle at Work or Play

  10. Posted by: ComponentGear.com Feed on April 10, 2009 at 10:19PM

    This week on Channel 9, Dan and Brian are joined by special guest Charles Torre! This week we discuss

  11. Posted by: This Week on C9: Charles Torre on camera, C9 turns 5, and lots of freebies « Bloggin on April 23, 2009 at 12:25PM

    Pingback from  This Week on C9: Charles Torre on camera, C9 turns 5, and lots of freebies « Bloggin

  12. Posted by: Windows 7 Taskbar .NET Sample Library – an Overview « vincenthome’s Tech Clips on April 24, 2009 at 2:30PM

    Pingback from  Windows 7 Taskbar .NET Sample Library – an Overview « vincenthome’s Tech Clips

  13. Posted by: US ISV Developer Evangelism Team on April 25, 2009 at 5:37PM

    The release candidate (RC) for Windows 7 is just around the corner. Dates for the Windows 7 RC were announced

  14. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 28, 2009 at 5:01AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  15. Posted by: Russian Coding 4 Fun on April 28, 2009 at 11:36AM

    Опубликовано 14 апреля 2009 в 10:13:00 | Coding4Fun Йошей Кириати ( Yochay Kiriaty) в своем блоге рассказывает

  16. Posted by: ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style on April 28, 2009 at 1:08PM

    Pingback from  ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style

  17. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 28, 2009 at 3:15PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  18. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 29, 2009 at 10:14AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  19. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 29, 2009 at 2:43PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  20. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 29, 2009 at 4:51PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  21. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 29, 2009 at 11:05PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  22. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on April 30, 2009 at 2:01PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  23. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 01, 2009 at 2:26AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  24. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 01, 2009 at 6:32AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  25. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 01, 2009 at 12:45PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  26. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 02, 2009 at 3:08AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  27. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 02, 2009 at 3:43PM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  28. Posted by: Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style on May 03, 2009 at 6:27AM

    Pingback from  Walkthrough to Get Your Applications Ready for Windows 7 | Coded Style

  29. Posted by: ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style on May 06, 2009 at 10:19PM

    Pingback from  ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style

  30. Posted by: ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style on May 06, 2009 at 10:19PM

    Pingback from  ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style

  31. Posted by: ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style on May 06, 2009 at 10:19PM

    Pingback from  ???????????????????? ?????? Window 7 ??? ???????????? ?????????? | Coded Style

  32. Posted by: bWindows 7/b Taskbar .NET Sample Library ??? an Overview - bWindows 7/b b…/b « Windows 7 Live Info on May 18, 2009 at 11:43AM

    Pingback from  bWindows 7/b Taskbar .NET Sample Library ??? an Overview - bWindows 7/b b…/b «  Windows 7 Live Info

  33. Posted by: bWindows 7 Taskbar/b .NET Sample Library ??? an Overview - bWindows 7/b b…/b « Windows 7 Live Info on May 18, 2009 at 1:02PM

    Pingback from  bWindows 7 Taskbar/b .NET Sample Library ??? an Overview - bWindows 7/b b…/b «  Windows 7 Live Info

  34. Posted by: linkfeedr » Blog Archive » Windows 7 Taskbar .NET Sample Library ??? an Overview - RSS Indexer (beta) on July 12, 2009 at 2:07PM

    Pingback from  linkfeedr » Blog Archive » Windows 7 Taskbar .NET Sample Library ??? an Overview - RSS Indexer (beta)

  35. Posted by: Twitter Trackbacks for Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 for Developers - The Windows Blog [windowsteamblog.com] on Topsy.com on August 29, 2009 at 4:22AM

    Pingback from  Twitter Trackbacks for                 Windows 7 Taskbar .NET Sample Library ??? an Overview - Windows 7 for Developers - The Windows Blog         [windowsteamblog.com]        on Topsy.com

  36. Posted by: Buy percocet online without office visit. on January 08, 2010 at 9:09AM

    Percocet online. Buy percocet online. Buy percocet online without office visit. Order percocet online. Cheapest percocet online.

  37. Posted by: Cheap payday loan. on January 17, 2010 at 10:40PM

    Cheap payday loan.