Annonyreeder Posted July 11, 2013 Share Posted July 11, 2013 Hello, I will try and explain my issue best i can without the code as i'm not at work and cannot provide it at this point in time, Once in work tomorrow i can post the code if needed. Ive wrote a code at work that uses IEAttach command to attach to a internet window by URL. However sometimes it is necessary to have 2 of these windows open and they both have the exact same URL and i need it to attach to the "active" most "recent" window however it will always attach to the previous "first" window open. Is there a way to define the new window over the old one without closing the original? perhaps a different form of "attaching" rather than URL? Sorry if i'm not being clear if needed i can post my code first thing in the morning. Thanks Ant. Link to comment Share on other sites More sharing options...
JohnOne Posted July 11, 2013 Share Posted July 11, 2013 Get handle of "active" window (WinGetHandle() ) and use HWND instead of URL. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Annonyreeder Posted July 12, 2013 Author Share Posted July 12, 2013 Thanks for the reply however i'm not quite sure what you mean i have not used HWD or Winhandles befor$sUrl = "http://172.30.238.40/CAisd/html/popup_frames.html?POPUP_URLIX=1+popupType=1" $oIE = _IEAttach($sUrl, "url") If not isObj($oIE) Then $sUrl = "http://172.30.238.40/CAisd/html/popup_frames.html?POPUP_URLIX=0+popupType=1" $oIE = _IEAttach($sUrl, "url") If not isObj($oIE) Then msgbox("", "Error// Mismatch address", "An error occurred, Reload application. If error persists contact Anthony") exit This is my current form of attaching where/how would i incorporate this into the script? Many thanks Ant. Link to comment Share on other sites More sharing options...
JohnOne Posted July 12, 2013 Share Posted July 12, 2013 $HWND = WinGetHandle("[ACTIVE]") _IEAttach($HWND, "HWND") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Annonyreeder Posted July 25, 2013 Author Share Posted July 25, 2013 Hey sorry for late reply ive only just rememberd i posted this issue, i tried using this method however i always get _IEAttach, $_IEStatus_NoMatch thats with any window. Link to comment Share on other sites More sharing options...
Annonyreeder Posted July 25, 2013 Author Share Posted July 25, 2013 Hey i actually got it working heres the code incase anyone gets similar issue WinWaitActive("Create New Incident") $sUrl = WinGetHandle("[ACTIVE]") $oIE = _IEAttach($sUrl, "HWND") If not isObj($oIE) Then $sUrl = WinGetHandle("[ACTIVE]") $oIE = _IEAttach($sUrl, "HWND") Thanks >< Link to comment Share on other sites More sharing options...
Juvigy Posted July 25, 2013 Share Posted July 25, 2013 This one should help you : $test = ProcessList("iexplore.exe") _ArrayDisplay($test) Exit That way you can choose to which instance to attach to , and not rely on the active window ! 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