If you have any modal windows open, they won't be released with a Clear Events. Since you're only using Deactivate Window All, they're not getting closed. Try Release Windows instead.
>Like everyone else I start applications with a .PRG which sets the environment, displays a splash screen, loads a menu system, etc. I check to see if the user is a valid user. if not I display a message and then I would like to exit the application. To exit I have a function called "Depart". When I do Depart the application does not close. What can I add to make the app close?
>
>*-------------------------------------------------------------------------------
>function Depart
>
>clear events
>deactivate window all
>pop key all
>on shutdown
>
>if _VFP.StartMode = 0 && Development Mode
> set sysmenu to default
> set library to
> modify window screen
> =sys(3056) && Reread Registry and config.vfp settings
>endif
>
>return .F.
>*-------------------------------------------------------------------------------