Jump to content

IENavigate issue


Recommended Posts

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

  • Moderators

$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

#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

 

Link to comment
Share on other sites

  • Moderators

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

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

 

Link to comment
Share on other sites

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

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

  • Moderators

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

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...