This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: System shutdown messages


On 5/9/2016 1:20 PM, Jon Turney wrote:
On 09/05/2016 14:35, Ken Brown wrote:
A Cygwin emacs user has asked
(http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483) whether emacs can
auto-save files when he shuts down Windows from the Start Menu.  Is
there a way for a Cygwin process to listen for Windows system shutdown
messages?

This seems entirely possible using the Win32 API.

For emacs-w32, it's probably straightforward to handle WM_ENDSESSION in
the message loop similarly to WM_CLOSE

This was indeed straightforward, so I went ahead and did it. But I didn't try to do anything for emacs-X11 and emacs-nox because it's more complicated, and...

But I'm not sure that's the best approach, or if wouldn't be more
appropriate to arrange for SIGTERM to be sent to emacs (or whatever) by
mintty or the X server when an WM_ENDSESSION is received...

... I hope Someone will do this.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]