[msw 2.8.7] Problem saving application settings when system is shut down

Vadim Zeitlin vadim at wxwidgets.org
Fri Apr 11 10:54:46 PDT 2008


On Fri, 11 Apr 2008 18:06:50 +0200 Eric Jensen <ml at j-dev.de> wrote:

EJ> i did some more research on this topic, putting debug output into a
EJ> file at many places in the wx eventloop and message handlers.
EJ> 
EJ> Although i can't provide a definite proof, i think the behavior i
EJ> described is indeed "normal":

 Thanks for your investigations! I didn't know that Windows terminated the
process forcefully in this case (this seems such a nasty thing to do, too)
but http://blogs.msdn.com/michen/archive/2008/04/04/Application-termination-when-user-logs-off.aspx
confirms that this is indeed the case. It also indirectly confirmed by the
MSDN documentation of WM_ENDSESSION:

	If the wParam parameter is TRUE, the session can end any time after
	all applications have returned from processing this message.
	Therefore, an application should perform all tasks required for
	termination before returning from this message.

 So we clearly have to destroy all the existing windows from either
wxWindowMSW::HandleEndSession() or, if we want this to be configurable,
from wxEVT_END_SESSION handler in wxApp. If you (or anybody) else can write
a patch adding such handler, it would be great. Of course, writing it
should be simple enough, it's the testing part which risks to be
time-consuming.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/



More information about the wx-users mailing list