Solved

Need to handle close event of window without any alert message

Posted on 2007-11-17
5
1,313 Views
Last Modified: 2008-02-20
Hi Experts,

I have a main window and a pop up from the main window. I made the  popup window like ModalDialog by keeping the focus always on popup window when the user moves to main window. This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). I controlled all the events of main window and made the popup to behave as actual modal, But i am not able to handle the events of main window close (X), maximize and minimize. Means even though i have my focus on popup window, i am able to close the main window by clicking 'X'. Is there any way that i can handle the event of 'X' and show my popup window back. I tried 'onbeforunload' but it is asking a confirmation alert from the user. I should NOT show any confirmation from main window and i want to focus the user back to popup window if the user click 'X' of main window. I hope there is solution for this. Thanks in advance
0
Comment
Question by:jayend_expert
5 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 168 total points
Comment Utility
there is no way to handle system (OS) event like the window close from within a web page 'cause it violates the sandbox policy, not sure if ActiveX can do it ..
0
 
LVL 17

Assisted Solution

by:gops1
gops1 earned 166 total points
Comment Utility
Why do not you use a customized modal
You can refer this site:
http://gabrito.com/post/enhancements-to-submodal

or google for "Submodal" and you get plenty of them
0
 
LVL 16

Assisted Solution

by:LeeKowalkowski
LeeKowalkowski earned 166 total points
Comment Utility
"This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). "

- If the modal dialog won't execute some of your activeX script, then your main window won't either.  Otherwise there's nothing stopping you from putting your activeX script in your main window and invoking it from your modal dialog, but it should work in your modal dialog too, perhaps you're doing something else wrong.

--
Lee
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now