PDA

View Full Version : capturing internet explorer's window close event



sivajothi
01-09-2002, 04:15 PM
Hi

I am new to windows scripting.I am developing a web application in which i need to capture the closing of the ie browser by the user.when the user closes the browser window, i need to capture that event and prevent the user from closing the window if certain condition is present.
I tried with javascript and vbscript.In that there is no event handler for window_Close.
Can this be achieved in wSH.How.Whether WSH will work in web environment.

thanks in advance
sivajothi

darkness
01-09-2002, 04:42 PM
There is a way to do it that I know BUT (Always one in every sentence) you need to open the application via a script file. Then you could capture the window close event.

I will look for the copy of the script.

Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato

adamdelves
01-09-2002, 09:35 PM
I know of a way to capture the quit event on Internet Explorer- but i don't know how to prevent the user from closing the window.

set ie = wscript.createObject("internetExplorer.Application", "event_")

ie.visible = true
ie.navigate "www.winguides.com"

do
loop while ie.readyState <> 4

sub event_OnQuit
MsgBox "Ie window closed cannot continue"
Wscript.quit
end sub

This won't however prevent the window from closing. It will terminate and ende the script safely tohugh. I am working on a way to prevent a user form closing the window and will let you know if i come up with a solution.