Gerdus van Zyl schrieb:
> 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.

It should not be a problem if you ship the generated file, as long
as the ITaskbarList* interfaces do not change (they should never change).

You would probably rename the 
comtypes.gen._683BF642_E9CA_4124_BE43_67065B2FA653_0_1_0
to something more sensible, and move out of the comtypes\gen directory
so that it doesn't get replaced or deleted by accident.

Creating an instance would be easier if you use code like
this which uses the _reg_clsid_ attribute from the generated CoClass:

from somewhere import ITaskbarList3, TaskbarList
taskbar = CreateObject(TaskbarList._reg_clsid_, interface=ITaskbarList3)

-- 
Thanks,
Thomas

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to