Sep
13
2009

Windows API Code Pack – Icon Overlays

Earlier this month v1.0 of the Windows API Code Pack was released. The API allows you to do things that are not currently available today. You can check out the site for a complete list of available features, but the one I am looking at right now is icon overlays.

Essentially, with icon overlays, you can change how your icon looks in the taskbar based on certain conditions in your application. For example, a virus scanner could overlay something over the icon to let you know when a scheduled scan is happening. A backup application could change the icon based the last time a backup was run. The use is really up to you, but for now I just wanted to play - nothing fancy just a checkbox that will overlay a green orb when checked, and remove it when unchecked.

Just to be clear we are not swapping two icons in and out. The first icon is the blue application icon, and the second is a green orb. The API will actually overlay the second one on the first (in the bottom right corner). It also provides some nice fading animation as well.

using Microsoft.WindowsAPICodePack.Taskbar; 
if (OverlayCheckbox.Checked) 
{ 
    Icon greenOrb = Properties.Resources.GreenButton; 
    TaskbarManager.Instance.SetOverlayIcon(greenOrb, "Some Status"); 
} 
else 
{ 
    TaskbarManager.Instance.SetOverlayIcon(null, ""); 
} 

iconOverlay

Add comment




biuquote
Loading


AdSense

Software engineer by hobby and trade. When I am not sitting in front of a computer, you can find me playing with my kids. I am lucky enough to be married to my best friend and high school sweetheart. Life couldn't be better!

 

All content is mine, not my employers

Chronology

Tweets

what is the easiest way to *just* the last changeset number from git?
21 hours ago via Silver Bird
@ParasValecha so it is a virus some marketing guy manage to win an award for? ;)
3 days ago via Silver Bird
@ParasValecha none. I think they are one of the worse "viruses" you can get. Thrashing your disk and hogging CPU any chance they get
3 days ago via Silver Bird
...i have gone 5 years without one and been fine
3 days ago via Microsoft
... and provide little value on a day to day basis. Don't go to random content, and don't open stuff you don't understand...
3 days ago via Microsoft
I wholeheartedly believe that virus scanners are one of the worst things to install. they really slow down your computer...
3 days ago via Microsoft
RT @CodeWisdom: "When your hammer is C++, everything begins to look like a thumb." - Steve Haflich #fb
5 days ago via rowi for Windows Phone
Follow me on Twitter