Thanks to this post
http://www.neowin.net/forum/index.php?s=6352ade29ce66f2b51506c64e455d2f4&showtopic=716968&st=0&p=590434472&#entry590434472

I got the idl that I could convert to a typelib and then use
cc.GetModule("taskbar.tlb");

The only trouble is you have to specify the
import comtypes.gen.TaskbarLib as tbl
taskbar 
=cc.CreateObject("{56FDF344-FD6D-11d0-958A-006097C9A090}",interface=tbl.ITaskbarList3)

instead of just:
taskbar = tbl.TaskbarList()

because the typelib from the IDL is missing, I am assuming it comes
with the Win7 SDK. This is a problem since I would have to ship the
generated interface if I decide to use this code.

Anyway usage is then straightforward:

taskbar.HrInit()
taskbar.SetProgressValue(hWnd,25,100)

Anyway I'm guessing/hoping there will be Windows 7 support in a future
version of win32com :-)

~G


On Thu, Sep 24, 2009 at 3:24 PM, Gerdus van Zyl <gerdusvan...@gmail.com> wrote:
> Hi,
>
> Has anybody played with the win7 taskbar api? I just love the taskbar
> progress bar and would like it in my little app. But since win7 isn't
> even commercially available (i got mine from msdn) samples are scarce.
>
> Working from some pascal examples /vb.net interop examples /msdn docs
> I made the following:
>
>        class ITaskbarList3(IDispatch):
>            #_idlflags_ = ['dual', 'oleautomation']
>            #_case_insensitive_ = True
>            _iid_ = comtypes.GUID('{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}')
>            _methods_ = [
>                COMMETHOD([],
>                            HRESULT,
>                            "SetProgressValue",
>                              ( ['in'], HWND, "hwnd" ),
>                              ( ['in'], c_longlong, "ullCompleted" ),
>                              ( ['in'], c_longlong, "ullTotal" )
>                          ),
>                COMMETHOD([],
>                            HRESULT,
>                            "SetProgressState",
>                              ( ['in'], c_int, "hwnd" ),
>                              ( ['in'], c_short, "tbpFlags" )
>                          ),
>                COMMETHOD([],
>                            HRESULT,
>                            "HrInit"
>                          )
>                ]
>
>        taskbar
> =cc.CreateObject("{56FDF344-FD6D-11d0-958A-006097C9A090}",interface=ITaskbarList3)
>        print taskbar.SetProgressValue(hWnd,50,100)
>
> which of course does not work it gives the following error:
> ValueError: Procedure probably called with too many arguments (16
> bytes in excess)
>
> Or if I could get some advice on how to find out what to gen via
> GetModule since the 3 different files mentioned
> actxprxy.dll,explorerframe.dll,shell32 gives  Error loading type
> library/DLL or in shell32's case doesn't have ITaskbarList3.
>
> any help in seeing what's wrong is appreciated.
>
> thank you.
>
> ~Gerdus
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to