• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1325
  • Last Modified:

Need to handle close event of window without any alert message

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
jayend_expert
Asked:
jayend_expert
3 Solutions
 
ahoffmannCommented:
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
 
gops1Commented:
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
 
LeeKowalkowskiCommented:
"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
 
Computer101Commented:
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now