Function Reference


_IEQuit

Close the browser and remove the object reference to it

#include <IE.au3>
_IEQuit ( ByRef $oObject )

Parameters

$oObject Object variable of an InternetExplorer.Application

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero.
@error: 2 ($_IEStatus_COMError) - COM Error in Object reference
3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
@extended: Contains invalid parameter number

Remarks

_IEQuit() is particularly important when creating or working with invisible instances of Internet Explorer.
When AutoIt exits when working with visible instances of a browser, the browser continues to run and the visible window is left for the user to manage.
When the browser instance is invisible however, when AutoIt exits the browser process is left running and there is no user interface to interact with and an orphan Iexplore.exe process is left running on the system.
It is therefore good practice to call _IEQuit() whenever the browser process is not needed after or just before the script exists.

_IEQuit() is not allowed with embedded browser objects created with _IECreateEmbedded().
The browser processes associated with those objects will close when their parent GUI window is destroyed.

Related

_IEAttach, _IECreate

Example

; Create an invisible browser window, navigate to a
; website, retrieve some information and Quit

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("http://sourceforge.net")
; Display the innerText on an element on the page with a name of "sfmarquee"
Local $oMarquee = _IEGetObjByName($oIE, "sfmarquee")
If IsObj($oMarquee) Then
    MsgBox($MB_SYSTEMMODAL, "SourceForge Information", $oMarquee.innerText)
Else
    MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), "SourceForge Information", "NO sfmarquee FOUND !!!")
EndIf
_IEQuit($oIE)