It is also possible to override the base OnDestroy() function like so:
void CMyAppView::OnDestroy()
{
// Overridden to close the app
if (foo == bar)
{
DoThis;
}
CView::OnDestroy();
PostQuitMessage(0);
}
Hope it helps -
Ron G{*filter*}
Quote:
> > I've written a program that needs to execute a bit of code if it
> is
> > running when a user quits windows. How do I do this - I know it has
> > something to do with WM_QUIT.
> Not exactly. The WM_QUIT message is sent to an application when it is
about
> to end. It may be about to end because the user is about to exit Windows
or
> it may be about to end because the user chose Close from the system menu.
> Check the docs for WM_QUERYENDSESSION and WM_ENDSESSION. They are the
> messages most connected to Windows' exit.
> Regards,
> Will