Kogmedia Posted May 24, 2007 Share Posted May 24, 2007 (edited) Hello, I have a $oIE _IECreate window on a website how do i detect the browser has been closed by the user? Thanks Edited May 24, 2007 by Kogmedia [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 25, 2007 Moderators Share Posted May 25, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now