My application uses the docview framework provided by wxWidgets. In the OnClose() method of my wxView-derived class I have to know whether only this single window is about to be closed or the whole application gets shut down. (I have to do some housekeeping work before all the windows get closed.)
Is there any event being fired when the application is exiting, before the views are getting closed?
I tried to set a flag in wxApp::OnExit(), but OnExit() is called only after all the windows have been closed already, so this doesn't work.
Update for some clarification: I don't want to know who initiated the closing of the application. I need to find out in wxView::OnClose() if the user just closes this single window or the application as a whole.