Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Windows 7 Taskbar .NET Sample Library – an Overview

03 Apr 2009   #1

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
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:

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.

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.

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.


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

Channel 9 videos:

Sasha Goldstein contributed to this blog -


My System SpecsSystem Spec
03 Apr 2009   #2


let's port it to XP
My System SpecsSystem Spec

 Windows 7 Taskbar .NET Sample Library – an Overview

Thread Tools

Similar help and support threads
Thread Forum
Use voice sample to recreate a different sample
I have a recording of my friends voice, is there some kind of program or code I can use to recreate his voice, and let him say a different sentence than the one I recorded? Any kind of help is appreciated.
Sound & Audio
Windows Embedded Standard 7 Overview .
More - Componentized System | Powered by Windows Embedded 7 | Windows Embedded Standard 7
Shortcut to library pinned to taskbar
Hi all, I have several libraries and I want to have a shortcut to one of them pinned on my taskbar, but I can't seem to do this. Any advice on how to do this would be great! Thanks in advance!
General Discussion
How do i change the library icon on the taskbar? How do i change that i icon? I know that I can change the other icons by making a shortcut on the desktop then right-clicking Properties->Change Icon but it dosent seem to work with the library icon. Is there a way to change it, or am i stuck with the default...
Windows 7 Libraries .NET Sample Library – an Overview

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 07:24.
Twitter Facebook Google+