catching msie NewWindow2 event
rupole at hotmail.com
Wed Jan 14 11:53:17 CET 2004
You have to return the out parameters.
to the bottom of OnNewWindow2.
"mic" <aldo123 at onet.pl> wrote in message news:bu146d$66p$1 at news.atman.pl...
> I'm trying to catch the MSIE NewWindow2 event using win32com interface.
> code I use is basically something like below:
> from win32com.client import DispatchWithEvents
> class Events:
> Browser = None
> def OnNewWindow2(self, ppDisp, Cancel):
> #catching the new window and trying to place it onto my own
> ppDisp = Events.Browser
> #Cancel = True - this doesn't work either (should prevent popup
> ie1 = DispatchWithEvents('InternetExplorer.Application', Events)
> ie2 = DispatchWithEvents('InternetExplorer.Application', Events)
> Events.Browser = ie2
> ie1.Navigate('http://jaak.sav.net/test.html') #url to the html document
> opens its own window
> I know that setting ppDisp value should work (at least I've seen it
> in C# code) but using it this way gives no results. What's more depending
> the url I use the event is triggered or not (other standard events work
> okay). I've seen ctypes COM implementation demo that makes similiar things
> but it looks so much more complicated than win32com api. Hope somebody has
> some insight on that...
More information about the Python-list