Jump to content

Connect an active IE window


Recommended Posts

Hello,

I'm creating a function that connects to an active IE window. From beginning it worked, but some applications are emerging that does not connect. Displays the error:
-> IE.au3 T3.0-1 Warning function from _IEAttach, $ _IESTATUS_NoMatch
Does anyone know how to help me?

Func _ConnectWindow()

    $oie = _IEAttach(WinGetHandle(""), "hwnd")
    If @error Then
        Return False
    Else
        Return $oie
    Endif    
    
endFunc

 

Link to comment
Share on other sites

Not 100%, but I just wanted to understand why it works for some and not for others and these windows contains titles. It is necessary to connect in a open and active window ie, ie until access I I do not know the title of it

Link to comment
Share on other sites

JohnOne, I can not send you the application I'm trying to access is private because of my service, but with banking sites do not work either. Can there be any network lock?

Chimp, the correct instance does not help me because I can have more than one open window and have to plug in a specifies.

Link to comment
Share on other sites

I changed my function to the function below:

Local $a = WinGetHandle("[Active]")
ConsoleWrite($a & @CRLF)
    
$oie = _IEAttach(WinGetHandle("[Active]"), "hwnd")
If @error Then
    Return False
EndIf

Return True

And I did the tests at the following sites:

http://www.bb.com.br/portalbb/home29,116,116,1,1,1,1.bb
https://www.itau.com.br/
http://www.caixa.gov.br/Paginas/home-caixa.aspx

all sites above worked, but it did not work at the site below:

http://mercantildobrasil.com.br/BeneficiarioINSS/Paginas/default.aspx

I did the tests with banking sites to maintain a standard. They know why it works in some and not in others? The handle that returns is the same for all, which leaves the error without any sense.

Link to comment
Share on other sites

Once again, works fine here.

#include <IE.au3>

Sleep(3000) ; Time to activate window.

$oie = _IEAttach(WinGetHandle("[Active]"), "hwnd")
If @error Then
    Exit MsgBox(0,0,0)
EndIf

_IENavigate($oie, "https://www.google.co.uk/")

 

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

JohnOne,

My script has to connect to an active window and get the url that window. So I created this function. The example above works sent me on the websites of banks? because for me does not work here.

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