Jewtus Posted September 2, 2014 Share Posted September 2, 2014 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 More sharing options...
Danp2 Posted September 2, 2014 Share Posted September 2, 2014 Review the help file entry _IECreate, specifically the $iTryAttach optional parameter. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
computergroove Posted September 2, 2014 Share Posted September 2, 2014 (edited) https://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm or https://www.autoitscript.com/autoit3/docs/functions/WinExists.htm Edited September 2, 2014 by computergroove 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 More sharing options...
Solution Jewtus Posted September 3, 2014 Author Solution Share Posted September 3, 2014 (edited) 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. https://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm or https://www.autoitscript.com/autoit3/docs/functions/WinExists.htm 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 September 3, 2014 by Jewtus Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now