Jump to content

_IECreate User Closes Object?


Recommended Posts

  • Moderators

You could do something like this...

#include <IE.au3>

$sURL = "www.google.com"
$oIE = _IECreate($sURL)
AdlibEnable("_IsClosedIE")

While 1
    If _IsClosedIE($oIE) Then
        ConsoleWrite("User has closed the browser!" & @CR)
        Exit
    EndIf
    Sleep(100)
WEnd

Func _IsClosedIE($o_IE)
    $fNotify = _IEErrorNotify()
    _IEErrorNotify(0)
    _IEPropertyGet($o_IE, "HWND")
    _IEErrorNotify($fNotify)
    If $IEComErrorNumber = -2147417848 Then
        Return 1
    EndIf
    Return 0
EndFunc   ;==>_IsClosedIE
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...