Check for a feature and not a version

The most important thing I learned from a presentation of Andrew Coates on Windows development was

If you use a specific feature of a Windows OS, check for that specific feature and not for the Windows OS version!

 

E.g. You create an awesome application that uses the new Windows 7 taskbar features!

bad BAD: DON’T determine the windows OS version and react on that (enable/disable functionality), but test the API for the feature!
DON’T use code mentioned in this blog post: “Determine Windows Version and Edition with C#” or more complicated here: C# Detect Windows OS Version


good GOOD: Use the API provided from Microsoft for Windows 7 : Windows API Code Pack

Add this namespace

using Microsoft.WindowsAPICodePack.Taskbar;

Verify this property on the class TaskbarManager

TaskbarManager.IsPlatformSupported

 

PS
In this blog post you can found how you use the progress bar of the Windows 7 taskbar

Latest Posts

Popular Posts