From Xojo Documentation
When the app is quitting, CancelClosing and Closing are called as a pair for each open window. Closing will be called after CancelClosing executes, assuming that the close wasn't canceled by the user.
Return True to prevent the window (and in the case of the Quit method, other open windows) from closing. The parameter appQuitting is True when the window is being closed because the whole app is quitting and False when only the window is being closed.
- Description of the termination process in DesktopApplication.CancelClosing.