【问题标题】:How to show progress in taskbar button on Windows 10?如何在 Windows 10 的任务栏按钮中显示进度?
【发布时间】:2020-08-26 05:25:22
【问题描述】:

我正在尝试在 Windows 10 的任务栏按钮上显示进度,但我在 Web 上找到的两种方法都不起作用。 以下示例失败,错误为OSError: [WinError -2147312566] Error when loading Typelib/DLL

CLSID_TaskbarList = "{56FDF344-FD6D-11d0-958A-006097C9A090}"
IID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}"

import comtypes.client as cc

cc.GetModule("TaskbarLib.tlb")

import comtypes.gen.TaskbarLib as tbl
taskbar = cc.CreateObject(CLSID_TaskbarList, interface=tbl.ITaskbarList3)

以下示例失败,错误为TypeError: There is no interface object registered that supports this IID

import pythoncom

CLSID_TaskbarList = "{56FDF344-FD6D-11d0-958A-006097C9A090}"
IID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}"

taskbar = pythoncom.CoCreateInstance(CLSID_TaskbarList, None, pythoncom.CLSCTX_ALL, IID_ITaskbarList3)
print(taskbar)

我做错了什么?

【问题讨论】:

  • 也许只有桌面应用程序的情况可能会影响某些东西。 ITaskbarList3 interfaceMinimum supported client Windows 7 [desktop apps only]
  • 我已经尝试过使用 tkinter 应用程序。同样的问题。
  • 它是 C#,而不是 Python,但这篇文章可能会有所帮助。 Windows 7 progress bar in taskbar in C#?

标签: python windows com taskbar


【解决方案1】:

我找到了解决方案。我不得不下载Taskbarlib.tlb。那么第一个例子就可以了。

猜你喜欢
  • 1970-01-01
  • 2012-01-27
  • 1970-01-01
  • 2020-12-02
  • 1970-01-01
  • 1970-01-01
  • 2011-05-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多