1 Reply Latest reply on Aug 4, 2008 5:49 AM by mjr81

    Detecting when system is shutting down

    tony0000000
      Hi

      I need to be able to save my html/js applications state when the system stops the app because the system is about to shut down. How could I detect this event?

      Cheers

      Tony
        • 1. Re: Detecting when system is shutting down
          mjr81
          I think the only way you can detect a "shutdown" is the application shutting down... the OS should close the app before shutting down. In that case, you may need to just have some application shut-down handlers. In javascript this would be something akin to:

          <script>
          window.nativeWindow.addEventListener("closing", onWindowClose);

          function onWindowClose(){
          //Application closing functionality goes here;
          }
          </script>