Search code examples
.netvb.netwindows-7overlaytaskbar

How to do overlay icons on the taskbar in Windows 7 for .NET


Microsoft's UX guidelines recommend that I use overlay icons to show when my application has information about statuses, like unread messages or connectivity.

However, I not having much luck finding a clear tutorial on how to get starting using overlay icons in my application. Can someone recommend one, or better yet, create a tutorial on their blog for betterment of mankind?

(The question title specifically mentions Windows 7, but I think it would also be useful for Vista to be included in this tutorial, as well as backwards compatibility issues with Windows XP, etc.)

Edit: This question was really asked for .NET 3.5 using WinForms. Here's a quick snippet of code that should work if you download the Windows API Code Pack referenced below in ken2k's answer.

Imports Microsoft.WindowsAPICodePack.Taskbar
' Add reference to Microsoft.WindowsAPICodePack.Shell.dll
' Snipped...

If TaskbarManager.IsPlatformSupported Then
  TaskbarManager.Instance.SetOverlayIcon(icon, altText)
End If

Solution

  • I would suggest using the Windows® API Code Pack for Microsoft® .NET Framework that wraps all the shell programming stuff.

    You'll find a very detailed article here that'll show you how to use it.

    Note that the Windows® API Code Pack doesn't work with XP (not supported), and is very limited with Vista. Overlay icons are only available on Windows 7 for instance.