I've got a comtypes based activex container for wxPython[1], and I'm
trying to find a way to prevent the default context menu in an
IWebBrowser2 control. After some googling it seems from some VB
sites[2] that there should be a OnContextMenu event coming from the
document object, but I can't seem to be able to catch it using comtypes.
When I try using GetEvents on the document property it just gives me
an exception.
>>> cc.GetEvents(ie.ctrl.Document, t)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File
"c:\tools\python25\lib\site-packages\comtypes-0.5.0a-py2.5.egg\comtypes\client\_events.py",
line 132, in GetEvents
interface = FindOutgoingInterface(source)
File
"c:\tools\python25\lib\site-packages\comtypes-0.5.0a-py2.5.egg\comtypes\client\_events.py",
line 52, in FindOutgoingInterface
interface = comtypes.com_interface_registry[str(guid)]
KeyError: '{00000000-0000-0000-0000-000000000000}'
I've tried getting some of the other available interfaces without any
success. There are also some 'oncontextmenu' properties documented in
MSDN for the various document elements, but those seem to be for
javascript callbacks and not what I'm looking for (and I can't seem to
get them to work anyway...)
Any suggestions on what to try next?
[1]
http://trac.wxwidgets.org/browser/wxPython/branches/WX_2_8_BRANCH/wx/lib/activex.py
http://trac.wxwidgets.org/browser/wxPython/branches/WX_2_8_BRANCH/wx/lib/iewin.py
[2]
http://www.xtremevbtalk.com/showthread.php?t=70303
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
comtypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/comtypes-users