Jump to content
Sign in to follow this  
furrycow

Determine activity on IE

Recommended Posts

furrycow

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

Share this post


Link to post
Share on other sites
Valuater

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

Share this post


Link to post
Share on other sites
furrycow

Perfect, thanks!

Although just a heads-up, the HTML reading part of it came up in error, when i was changing webpages fast, it was some object error in the IE.au3.

Thanks again!


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites
Valuater

Welcome!

Just add the IE error handler. Be sure to see....

_IEErrorHandlerRegister()

and

_IEErrorNotify()

8)


NEWHeader1.png

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  

×