views:

1008

answers:

4

Windows 7 has an AWESOME new feature that applications can report the progress of the current activity through the status bar. For example, when copying file(s) using Windows Explorer, a progress bar is layered on top of the application icon in the task bar and the progress is shown as it updates.

What is the API for exposing the progress bar? Is there MSDN documentation on it?

+7  A: 

There's a good article in MSDN magazine about the new taskbar APIs. And yes, the feature is awesome :-)

Essentially, it's all about implementing IFileOperation. There's a good article about using it in managed code here.

sigint
+1  A: 

I've written an article about implementing the Windows 7 Taskbar progress API in C# (see: Windows 7 Taskbar Progress Bar with C# and .NET). The control is open source (BSD) and has example projects for C# and VB.NET.

This way you don't have to convert the C++ code from scratch.

Wyatt O'Day
+2  A: 

If you plan to use other Windows 7 Taskbar features, another approach would be to use the library from Microsoft: Windows API Code Pack for .NET Framework (http://code.msdn.microsoft.com/WindowsAPICodePack)

Keeron
+2  A: 

Using the Windows API Code Pack from Microsoft (as Keeron mentioned), it's really simple. You just need to use the TaskbarManager. E.g.

To start the progress:

TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Normal);

To update the progress:

TaskbarManager.Instance.SetProgressValue(currentValue, maxProgressValue);

And when when you're done, to end the progress:

TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.NoProgress);

There is more you can do, but that should get you started and might be all you need.

Wilka