Jump to content

Determine activity on IE


Recommended Posts

Just a quickie...

is there a function of any kind to determine whether or not something has just happened in IE (im using it embedded if that makes a difference). So for instance, if a link on a page was clicked?

Or even more efficiently, a way of determining when a web address of an instance has changed.

Currently, i've got this method, but it is hardly accurate, and although it does pick it up most of the time, it does quite often fail, for obvious reasons.

#include <IE.au3>

$oIE=_IECreate("about:blank")
$address2="about:blank"

While 1

$address1 = _IEPropertyGet($oIE, "locationurl")

If $address1 <> $address2 Then Msgbox(0,"","The web address has changed")

$address2= _IEPropertyGet($oIE, "locationurl")

Sleep(500)

WEnd

Is there a better solution??

Thanks.

Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

Maybe,,,

#include <IE.au3>

$oIE = _IECreate("about:blank")
$handle = WinGetHandle("")
$address2 = "about:blank"
$text2 = "" ;

While WinExists($handle)

    $address1 = _IEPropertyGet($oIE, "locationurl")
    If $address1 <> $address2 Then
        MsgBox(0, "", "The web address has changed")
        $address2 = $address1
    EndIf

    $text = _IEBodyReadHTML($oIE)
    If $text <> $text2 Then
        MsgBox(0, "", "The text has changed")
        $text2 = $text
    EndIf


    ; etc. etc. etc


    Sleep(100)

WEnd

8)

NEWHeader1.png

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