pythoncom InternetExplorer.Application don't work in vista || firefox pythoncom ?

gcmartijn at gmail.com gcmartijn at gmail.com
Sat Jul 5 04:12:04 EDT 2008


H!

I using a script that opens a internet page in a small window (what I
can control)
In XP everything was working fine, but now I'm using Vista with IE7
and this is what happends now:

First a small window opens at the postion x0 y0 (like I want) but then
IE thinks "Hey lets open a other main window too".
And that window opens the url 'http://www.google.nl'

It seems that I can't control/use my first window anymore, and that
IE7/vista is forcing to open it in a big new window.

The code below is what I'm using.

def webbrowser(url=None):
    import pythoncom
    from win32com.client import Dispatch

    ie = pythoncom.CoCreateInstance("InternetExplorer.Application",
None,pythoncom.CLSCTX_SERVER,pythoncom.IID_IDispatch)
    ie = Dispatch(ie)
    ie.Top = 0.0
    ie.Left = 0.0
    ie.Height = 400
    ie.Width = 400
    ie.AddressBar = False
    ie.MenuBar  = False
    ie.Resizable = False
    ie.StatusBar = False
    ie.ToolBar = False
    ie.Visible = 1
    return ie

w = webbrowser()
w.Navigate('http://www.google.nl')

--
ow and why can't I find a pythoncom.CoCreateInstance.FireFox example ?

Thanks for helping.



More information about the Python-list mailing list