使用 Windows 资源管理器命名空间扩展中的 Windows 7 任务栏进度指示器
我有一个命名空间扩展,当用户执行某些操作时,我们会在单独的窗口中显示进度条(理想情况下,我们应该使用地址栏中的 Windows 资源管理器内置进度指示器,但我被告知没有 API来自我的组件供应商)。我使用 Windows Code Pack 1.1 来获取 .NET API。
此进度窗口是常规的 Windows 窗体窗口。我已包含以下代码:
...
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);
}
}
}
...
我希望资源管理器图标显示进度,但这不会发生。我尝试添加 Handle 属性作为参数,但这似乎没有帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它是一个命名空间扩展,您应该使用 IProgressDialog 接口,它内置于资源管理器中,并且原生支持 Windows 7 上的任务栏进度指示器。
http://www.codeproject.com/KB/dotnet/winprogressdialog.aspx
http://www.codeproject.com/KB/shell/iprogressdialognet.aspx
dmex
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
你设置状态了吗?
这会给你一个红色的。黄色为暂停,绿色为正常。
Did you set the state?
That will get you a red one. Paused for yellow and Normal for green.