From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Exit hooks not run at logout on w32 Date: Tue, 04 Jul 2006 09:49:54 +0100 Message-ID: <44AA2BB2.4090709@gnu.org> References: <44A005B7.2080904@student.lu.se> <44A03B61.8080501@student.lu.se> <44A2B99B.1020002@student.lu.se> <44A2F974.7040609@gnu.org> <44A31C19.5050000@student.lu.se> <44A3A2DE.4040507@gnu.org> <44A3E918.5000304@student.lu.se> <85lkrg3t3a.fsf@lola.goethe.zz> <44A3FCCD.4040203@student.lu.se> <7dbe73ed0606291440r15b9f5pd1c7f35344d79c42@mail.gmail.com> <44A4576F.7060004@student.lu.se> <44AA10EC.2080503@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152003042 14399 80.91.229.2 (4 Jul 2006 08:50:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2006 08:50:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 04 10:50:38 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fxgc3-0006Az-Cr for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 10:50:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fxgc2-0008FY-VG for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 04:50:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fxgbk-0008DF-3K for emacs-devel@gnu.org; Tue, 04 Jul 2006 04:50:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fxgbi-0008Bc-MD for emacs-devel@gnu.org; Tue, 04 Jul 2006 04:50:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fxgbi-0008BN-DV for emacs-devel@gnu.org; Tue, 04 Jul 2006 04:50:10 -0400 Original-Received: from [213.86.207.50] (helo=exchange.integrasp.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FxgpL-0007Mu-Qj for emacs-devel@gnu.org; Tue, 04 Jul 2006 05:04:16 -0400 Original-Received: from [192.168.111.61] (localhost [127.0.0.1]) by exchange.integrasp.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id NMA81VHW; Tue, 4 Jul 2006 09:42:00 +0100 Original-Received: from 192.168.111.61 ([192.168.111.61] helo=[192.168.111.61]) by ASSP-nospam; 4 Jul 2006 09:42:00 +0100 User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) Original-To: Mathias Dahl In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56471 Archived-At: Mathias Dahl wrote: > Applications with a window and message queue receive shutdown > notifications through the WM_QUERYENDSESSION message. These > applications should perform any required cleanup while processing > this message and return TRUE to indicate that they can be > terminated. > > So, I conclude that displaying a dialog box ("Do you want to save bla > bla?") would violate the "rules" above, wouldn't they? > That was my same conclusion, based on reading the documentation of the actual system messages. But it is interesting that the advice above contradicts the advice in the documentation for WM_QUERYENDSESSION, which says you should NOT perform cleanup while processing that message, but save it for WM_ENDSESSION. I think the contradictions in Microsoft's documentation about shutdown are what is causing the confusion here. Lennart posted another contradiction, where in the documentation for InitiateSystemShutdown, there is advice that applications can delay shutdown if they have unsaved data if a particular flag is passed. But that advice is for users of InitiateSystemShutdown, not for recipients of the shutdown messages, so my opinion is that it is informing of worst case expectations for code that wants to shut the system down (assuming that not all applications will take the advice elsewhere - apparently some of Microsoft's own products do not).