Jump to content

IEAttach or create


Jewtus
 Share

Go to solution Solved by Jewtus,

Recommended Posts

I was wondering if there is a UDF or anything that will automatically detect if an IE window is open and bind to it and if not, create a new IE window. I've been trying to figure out a way to do it with if statements but its getting really cumbersome and I feel like this is something that someone else must have already figured out.

Link to comment
Share on other sites

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

  • Solution

Review the help file entry _IECreate, specifically the $iTryAttach optional parameter.

I tried that, however it keeps not recognizing that there is an IE window open.

Winexists requires that I know something about the IE window. I did take a look at process exists, but once I have the PID, how do I actually attach to it?

 

EDIT: I think I've figured it out

If ProcessExists("iexplore.exe") <> 0 Then
                    $oIEhWND= _WinAPI_EnumProcessWindows(ProcessExists('iexplore.exe'))[1][0]
                    $oIE=_IEAttach($oIEhWND,"hwnd",1)
                    _IENavigate($oIE,$url)
                Else
                    $oie=_IECreate($url,1)
                EndIf
Edited by Jewtus
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...