Fires when the window of the object is about to be closed by script.
void WindowClosing( VARIANT_BOOL IsChildWindow, VARIANT_BOOL *Cancel );
- [in] A VARIANT_BOOL that specifies whether the window was created from script. Can be one of the following values.
- Window was not created from script.
- Window was created from script.
- [in, out] A pointer to a cancel flag. A VARIANT_BOOL value that specifies whether the window is prevented from closing. Can be one of the following values.
- Window is allowed to close.
- Window is prevented from closing.
No return value.
The DISPID for this event is defined in exdispid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.
This event is fired when a window is closed from script, by using the window.close method.
The default behavior of Windows Internet Explorer is to close windows that were created by script without asking the user. If an attempt is made to close the main InternetExplorer window or the WebBrowser control window through script, the user is prompted.
This event is available only to an application that is hosting the WebBrowser control installed by Microsoft Internet Explorer 5.5 and later.