ON SHUTDOWN Command
Specifies a command that executes when you try to exit Visual FoxPro, or Microsoft Windows.
ON SHUTDOWN [Command]
Issue ON SHUTDOWN without Command to release the current ON SHUTDOWN command.
The command you specify in ON SHUTDOWN is executed if you try to exit Visual FoxPro. If you try to exit Microsoft Windows while Visual FoxPro is open, control is returned to Visual FoxPro and the command you specify in ON SHUTDOWN is executed.
The ON SHUTDOWN command is typically a DO command that executes a routine to display a dialog box. The dialog box asks if you are sure you want to exit the current application and Visual FoxPro. If you want to exit the application, the routine can close open files, clean up the Visual FoxPro environment and then execute QUIT. If you don't want to exit the current application, the routine can return control back to the application.