Hi Allen,
In addition to what James and Ed suggested make the first line of your exit routine ON SHUTDOWN.
>To All,
>
>I have a program exit routine that closes files, ends the event read, and terminates the application gracefully. How can I run that routine when someone clicks in the VFP desktop screen X button? Unless I stop reading events, FoxPro reports that it cannot quit.
>
>Thanks,
>Allen
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada
cmagee@metroland.comNever mistake having a career with having a life.