views:

22

answers:

2

I have a namespace extension and when the user does certain action we display a progress bar in a separate window (Ideally we should use the Windows Explorer built in progress indicator in the address bar, but I'm told that there isn't an API for that from my component vendor). I using the Windows Code Pack 1.1 to get a .NET API.

This progress window is a regular Windows Form window. I've included the following code:

...
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Taskbar;
...
public sealed partial class ProgressWindow : Form, IProgressPresenter
{
    ...
    public int ProgressLevel
    {
        get { return JobProgress.Value; }
        set
        {
            JobProgress.Value = value;

            if (TaskbarManager.IsPlatformSupported)
            {
                TaskbarManager.Instance.SetProgressValue(value, 99);
            }
        }
    }
...

I would like the Explorer icon to display the progress, but this doesn't happen. I've tried to add Handle property as a parameter, but this doesn't seem to help.

A: 

Did you set the state?

TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Error);

That will get you a red one. Paused for yellow and Normal for green.

Kate Gregory
Yes - I did initialize it when the progress begins to TaskbarProgressBarState.Normal.
tronda
A: 

(Ideally we should use the Windows Explorer built in progress indicator in the address bar, but I'm told that there isn't an API for that from my component vendor)

If its a namespace extension your supposed to use the IProgressDialog interface, Its built into Explorer and also nativity supports the Taskbar progress indicator on Windows 7.

http://www.codeproject.com/KB/dotnet/winprogressdialog.aspx

http://www.codeproject.com/KB/shell/iprogressdialognet.aspx

dmex

dmex
Thank you for the tip. Do you know if it is possible to get Windows Explorer address bar indication of progress on Win7?
tronda