[python-win32] IE toolbar button in Python

Mark Hammond mhammond at skippinet.com.au
Thu Mar 9 02:33:19 CET 2006


> Roger Upole wrote:
> >
> > There's an IE toolbar button demo in CVS:
> >
> http://cvs.sourceforge.net/viewcvs.py/pywin32/pywin32/com/win32com
> /demos/iebutton.py?rev=1.1&view=log
> >
> I looked at this, but can't figure out what to do with it. Are there any
> instructions? What seems apparant is that it creates a COM server. But
> then what?

Yes, it is very unclear.  I just checked in a new version with the following
docstring:

"""
This sample implements a simple IE Button COM server
with access to the IWebBrowser2 interface.

To demonstrate:
* Execute this script to register the server.
* Open Pythonwin's Tools -> Trace Collector Debugging Tool, so you can
  see the output of 'print' statements in this demo.
* Open a new IE instance.  The toolbar should have a new "scissors" icon,
  with tooltip text "IE Button" - this is our new button - click it.
* Switch back to the Pythonwin window - you should see:
   IOleCommandTarget::Exec called.
  This is the button being clicked.  Extending this to do something more
  useful is left as an excercise.

Contribtions to this sample to make it a little "friendlier" welcome!
"""

(Note that I also added an 'import win32traceutil' for the above to be
true - you will need to add it too, or just grab the new copy)

I'm also fairly sure it will not work until I release a new pywin32 - I'll
do that soon!

Cheers,

Mark



More information about the Python-win32 mailing list