Using Windows 7 taskbar features in PyQt

As quark said, the functionality is not in Qt 4.5, but you can call the windows API directly from Qt. Its a little bit of work though.

  1. The new taskbar API is exposed through COM, so you can’t use ctypes.windll . You need to create a .tlb file to access the functions. Get the interface definition for ITaskbarList from this forum post , or from the windows SDK. Save it to a file called e.g. TaskbarLib.idl .

  2. Create the .tlb file. You’ll probably need the Windows SDK, or get an IDL compiler from somewhere else.

    midl TaskbarLib.idl /tlb TaskbarLib.tlb
  3. Load the .tlb (you need the Win32 Extensions for Python,

    import comtypes.client as cc
  4. Create the TaskbarList object. The function for setting the progress bar is in the interface ITaskbarList3:

    import comtypes.gen.TaskbarLib as tbl
    taskbar = cc.CreateObject(
  5. Now you can call the API functions:


Here’s a complete example script.

Leave a Comment