I have a function that is to run when my app is closed. I stuck it in the form's terminate event and it runs like it's supposed to when I use the menu to exit or a command button to exit. Now, when I try to use the close box at the top, it doesn't run. Is there a way I can get this to work? What kind of event happens when someone shuts down the app this way?