application terminate doesn't call form destroy ???

Rob Davis <> wrote in article

> My problem is that if the application is ended via a close down of
> windows or application.terminate these normal close down routines
> appear to be short circuited and no entry is made in the loggedin
> table, nor, I assume, are the databases closed correctly.

> Would anyone have any suggestions as what I might do?  Is there an
> application message OnTerminate that I might intercept ?  Can anyone
> shed any light on this please ?

Hmm... I think that you're only intercepting the WM_CLOSE message using the
CloseForm method and not the WM_QUIT message. I recall that there was also
a WM_SHUTDOWN message to back in win16. I suggest that you add some
additional message methods to your form class for these events.