Ian,
You need an ON SHUTDOWN handler and a CLEAR EVENTS. There's an example on my website.
>I have generated my application in .exe format. However when I run the exe, nothing happens but yet, the program appears in the program manager. Moreover when I click 'END TASK' a dialog appears saying 'cannot quit Visual FoxPro'.