1 Reply Latest reply on Jul 29, 2008 7:45 AM by elcadar

    Application close Event (OS default menu)

      I have to develop an mulitiple window application which uses shared object heavily.
      These two features imposes two constrains:
      1. When main application gets close all native windows must get close.
      2. Application should not loose any data at the time of exit (if shared object is used each time updation occurs , it degrades the performance).Ideal way of doing this is to save the data at the time of application termination.

      Now the problem is if I close the application from OS default menu( minimize, maximize, restore, close), I do not get any notification and left with all the opened native windows and unsaved data.

      Could anyone pls help me for the same?

      Thanks in advance
        • 1. Re: Application close Event (OS default menu)
          Closing an application from the menu in the taskbar generates Event.CLOSING. Add an event listener to the main application to capture this event. Within, put in the code to save all your native window state information, and then close all the windows in the desired order.

          When closinig the app using your own application menu, you can manually dispatch events to make the same actions occur. In this case, dispatch Event.CLOSING and let your handler take care of the rest.