Jump to content
Sign in to follow this  
FillanTroop

IENavigate issue

Recommended Posts

FillanTroop

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

 

Share this post


Link to post
Share on other sites
JLogan3o13

$oObj = ObjCreate("Shell.Application")

With $oObj.Windows
    If .Count > 0 Then
        $oIE = .Item(0)
    EndIf
    $oIE.Navigate("http://www.yahoo.com")
EndWith


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
MikahS

#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 by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Share this post


Link to post
Share on other sites
JLogan3o13

The OP did state _IEAttach is not working for him, thus the alternative method...


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
MikahS

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 by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Share this post


Link to post
Share on other sites
jdelaney

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.

Share this post


Link to post
Share on other sites
FillanTroop

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!

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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
Sign in to follow this  

×