0 Replies Latest reply on Jul 25, 2009 8:57 AM by SilentChris

    Detecting how an application is closed

    SilentChris

      I'm trying to incorporate the behavior into my application where when you close all the windows, the app doesn't actually close but the windows just get hidden.  However, as a general rule this only happens when you either click the close button on the window or when using cmd/ctrl-W to close windows.  Other methods of quitting (alt-f4, cmd-q, choosing "Quit" from a menu) should actually close the application.

       

      Right now, I'm just hooking into the "closing" event on a WindowedApplication.  The problem I have is that I can't tell the difference between the different types of closing.  Is there any way to detect what happened to cause the closing event?  Or alternatively, is there a way I could detect a user clicking on the close button on the window without having custom chrome? (That way, I could just let the rest of the events that cause  the closing event to fire to actually close the app).