I'm trying to show the progress on the taskbar button on Windows 10, but both methods I've found on the Web do not work.
The following example fails with the error 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)
and the following example fails with the error 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)
What am I doing wrong?