Windows Clost Button in AMS 7.5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • u863583
    Forum Member
    • Jan 2005
    • 26

    Windows Clost Button in AMS 7.5

    I have looked through forums, but am failing to find any code to do this. I need to trap when a user clicks the "X" close button at the top right of the program so that I can perform some house-cleaning before exiting.

    Does some code need to be places on each page, or is there a global way to trap this. I this done with a click or key event on the page? Any help would be most appreciated.

    thanks

    Manny
  • Dermot
    Indigo Rose Customer
    • Apr 2004
    • 1791

    #2
    Use the On Shutdown event.
    Dermot

    I am so out of here :yes

    Comment

    • u863583
      Forum Member
      • Jan 2005
      • 26

      #3
      Thank you for reply. Also just found on the forum this code that when placed on the Global section also traps hitting the close button. I will take a look at the event.
      --------------------------------------
      function QueryAllowProjectClose()
      result= Dialog.Message("Application Exit", "Are you sure that you want to quit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
      --if they choose yes
      if result == IDYES then
      --allow the app to close
      return true;
      else
      --cancel close
      return false;
      end
      end

      Comment

      • Dermot
        Indigo Rose Customer
        • Apr 2004
        • 1791

        #4
        That function is useful if you want to prevent it from being closed or you want the user to confirm. If you just want to do some clean up the the On Shutdown event is the easiest.
        Dermot

        I am so out of here :yes

        Comment

        • u863583
          Forum Member
          • Jan 2005
          • 26

          #5
          Hi Dermot,

          Yes, I agree. You are correct. Issue was I was not even aware that event was there. Found it under Project/Actions section. Always thought it should exist, just did'nt know where it was or forgot about it over the years. For what I am doing that is the correct event. Exactly what I needed.

          thanks again and regards,

          Manny

          Comment

          Working...
          X