From Xojo Documentation
The Window is about to close. You cannot cancel the closing at this time. If you need to decide or interact with the user to make sure that the Window should be closed, use DesktopWindow.CancelClosing event instead which is called before DesktopWindow.Closing.
- Description of the termination process in DesktopApplication.CancelClosing.