Windows 7 Taskbar – Application ID

Yan Cui

I help clients go faster for less using serverless technologies.

This article is brought to you by

Don’t reinvent the patterns. Catalyst gives you consistent APIs for messaging, data, and workflow with key microservice patterns like circuit-breakers and retries for free.

Try the Catalyst beta

By now, Windows 7 is almost old news and most of you would have been using or at least seen Windows 7 and one of the first things that should have caught your attention is the redesigned task bar.

The new task bar are visually much more pleasant and functionally it has also introduced a number of rather useful new features such as the ‘jump list’ and the ability to display the progress bar on the task bar icon itself! In addition, multiple running instances of the same application is grouped together and when you hover over the icon you get a preview of each instance (see below).

image

The task bar works out which windows to group together by using the Application User Model IDs (referred to as AppIDs from here on). In most cases you can rely on the AppID assigned to a process by the system. However, an application that owns multiple processes or an application that is running in a host process might need to explicitly identify itself so that it can group its otherwise disparate windows under a single taskbar button and control the contents of that application’s jump list.

Support for the new task bar features is not included in the core .Net framework, you need to download the latest Windows API Code Pack (see References section), build the solution and reference these two dlls in your project:

Microsoft.WindowsAPICodePack.dll

Microsoft.WindowsAPICodePack.Shell.dll

It takes only one line of code to set the AppID of a new window, however, it pays to write safe code that won’t break outside Windows 7 so your code will usually look more like this:

// Check whether the taskbar feature is supported (Win 7 or Win Server 2008 R2)
if (TaskbarManager.IsPlatformSupported)
{
    // Set the AppID for the current process TaskbarManager.Instance represents an 
    // instance of the Windows Taskbar
    TaskbarManager.Instance.ApplicationId = "NewApplicationID";
}

References:

WindowsAPI Code Pack

Windows7 Training Kit for Developers

Whenever you’re ready, here are 3 ways I can help you:

  1. Production-Ready Serverless: Join 20+ AWS Heroes & Community Builders and 1000+ other students in levelling up your serverless game. This is your one-stop shop for quickly levelling up your serverless skills.
  2. I help clients launch product ideas, improve their development processes and upskill their teams. If you’d like to work together, then let’s get in touch.
  3. Join my community on Discord, ask questions, and join the discussion on all things AWS and Serverless.

Leave a Comment

Your email address will not be published. Required fields are marked *