FillanTroop Posted September 4, 2014 Share Posted September 4, 2014 Hi Guys, I tried to find out the answer here, but no luck. I need to redirect EXISTING IE window to another URL. There is tens of examples, but always with IEcreate. I can't open new IE window. I just need to activate (WinActivate) explorer and then redirect it to another page. I am going to deactivate hundreds of users on weekly basis in some app (web UI) and I have to repeat the action for each one of them. I really can't have hundreds of existing IE windows and I would like to avoid kill each one of them after its finished. Thank you in advance for any advice or hint. I am getting desperate. :-) (I tried also _IEAttach, but does not work, always open a new window) Filip Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 4, 2014 Moderators Share Posted September 4, 2014 $oObj = ObjCreate("Shell.Application") With $oObj.Windows If .Count > 0 Then $oIE = .Item(0) EndIf $oIE.Navigate("http://www.yahoo.com") EndWith "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MikahS Posted September 4, 2014 Share Posted September 4, 2014 (edited) #include <IE.au3> Opt("WinTitleMatchMode", 2) $a = "- Microsoft Internet Explorer" Do Sleep(10) Until WinExists($a) $b = WinGetHandle($a) WinActivate($B) $c = _IEAttach ($b, "HWND") _IENavigate ($c, "www.autoitscript.com") Edited September 4, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 4, 2014 Moderators Share Posted September 4, 2014 The OP did state _IEAttach is not working for him, thus the alternative method... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MikahS Posted September 4, 2014 Share Posted September 4, 2014 (edited) True, and you posted a solution. Without their script how can I know they did it right? Well now they will know EDIT: Apologize if I was rude, I did read that you tried to use _IEAttach, but wasn't sure how you were using it. This is the reason I still posted a solution with _IEAttach. Edited September 4, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
jdelaney Posted September 4, 2014 Share Posted September 4, 2014 One more route, very similar to MikahS (not waiting though) #include <IE.au3> $hwnd = WinGetHandle("[CLASS:IEFrame]") If IsHWnd($hwnd) Then _IEAttach($hwnd,"HWND") Else ConsoleWrite("no IE open" & @CRLF) EndIf I'm not sure if the title will always have that text appended. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Danp2 Posted September 4, 2014 Share Posted September 4, 2014 The following should work: #include <IE.au3> $oIE = _IEAttach ("", "instance", 1) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
FillanTroop Posted September 5, 2014 Author Share Posted September 5, 2014 Thank you all guys very much. I did not post the code because after all, all I needed was to redirect and does not matter how and thanks to your examples I finally understand how it works. So I combined some of the codes you gave me and it works better than I even wanted on the beginning. THANKS AGAIN! Resolved! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 5, 2014 Moderators Share Posted September 5, 2014 FillanTroop, glad you were able to resolve your issue. You might think about posting what you used in the end, so that someone searching in the future will be able to try your solution. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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