Click to See Complete Forum and Search --> : Capturing windows exit


Carnegie
May 13th, 1999, 03:54 AM
I'm trying to put a check into the exit routine for my application. I've trapped the ID_APP_EXIT command for 'File Exit' from the menu, but I'm unable to capture either ALT F4 or either of the application title bar exit buttons.

Can anyone help, as I can't trust the users to close the application using File Exit every time!

Carnegie

Bob Clarke
May 13th, 1999, 04:51 AM
Trap the WM_QUIT message and do what you need before passing it on.

Carnegie
May 13th, 1999, 05:15 AM
Yeah - that's what I thought.

It doesn't seem to work!
Should I be capturing on the CWinApp or on the CMDIMainFrame - or somewhere else entirely?

sally
May 13th, 1999, 07:49 AM
Maybe try to catch WM_CLOSE on the main window?

Sally
May 13th, 1999, 07:49 AM
Maybe try to catch WM_CLOSE on the main window?

Carnegie
May 13th, 1999, 08:04 AM
Yeah - I got it to work by capturing WM_CLOSE on the Main Frame