Improve your contact center performance. See how you can make a difference.
Watch Now
Engage and build your ICT audience with CIOL online advertising.
Know more
All new features in Windows 7 are available using the Windows 7 SDK. However for this series, we'll perform these tasks with .NET. You will need Visual Studio 2008 or Visual C# Express 2008 with service pack 1. You will also need the Windows API Code Pack for .NET from http://tinyurl.com/ohbsuq.
Download the file and extract it anywhere on your system. Now create a new Windows application project and then add two existing projects from within the WindowsAPICodePack folder where you extracted the archive ? Core and Shell. Also add these two projects as 'references' to the Windows application project you created. This will enable your WinForms project to use the new features in Win7.
Icon Overlays In earlier versions of Windows, whenever an application wanted to display some status to the user, it would use the Notification Area/System Tray (the place near the clock on the Taskbar) to show up an icon. This was 1) fairly counter-intuitive as most people would miss it and 2) will not work nicely on Windows 7 as the Notification Area is by default kept clean and all icons are pushed off into a popup bubble ? where it will not be seen most probably.
In Windows 7 there is a much better way of doing this. You can now display a status icon over the application's icon on the Taskbar ? which makes it much easier to notice. A lot of new apps are now doing precisely this to draw attention to a status. For instance Windows Live Mail and the new Outlook 2010 display a new mail icon over the application icon whenever there are any unread e-mails. You too can add this into code in your application. First open the code for your main form and add the following using statements at the top:
using Microsoft.Windows APICodePack. Shell; using Microsoft.Windows APICodePack. Shell.Taskbar;
Now drop a button on the form and add the following into the button's click event:
private void btnOverlay_Click(object sender, EventArgs e) { if (Taskbar.OverlayImage.Icon == null) Taskbar.OverlayImage = new OverlayImage(SystemIcons.Asterisk, "Hello"); else Taskbar.OverlayImage = null;}
This simple code first checks whether the application's icon already has an overlay set and if not, adds a simple icon from the system icons. Note you can load any icon from a resource file for your app if you want. Such a code would allow you to display different icons to represent the status of your application at different times, which the user can view to get immediate feedback even if he is working on something else.
Application ID Another nice feature of Windows 7 is the Taskbar grouping of an application's icons. If there are multiple instances of an application, they are all automatically grouped under the same icon on the Taskbar to save space. You can however control this by using a feature known as Application ID.
NEXT>>