|
From: | Lennart Borgman |
Subject: | Re: Exit hooks not run at logout on w32 |
Date: | Thu, 29 Jun 2006 00:41:41 +0200 |
User-agent: | Thunderbird 1.5.0.4 (Windows/20060516) |
Jason Rumney wrote:
No. Not if you return TRUE in ctrl_c_handler. I am however not sure what will happen next then. If Emacs exit directory after the call to save-all-buffers-kill-emacs, will the logoff continue then?Lennart Borgman wrote:Actually emacs recieve a control event instead, CTRL_LOGOFF_EVENT during my testing. (It could also be CTRL_SHUTDOWN_EVENT and probably CTRL_CLOSE_EVENT.) This event can be catched in ctrl_c_handler in w32console.c. I have tried that and then used PostThreadMessage (dwWindowsThreadId, WM_EMACS_KILL, 0, 0) to be able to call save-buffers-kill-emacs later on.You can not run commands that require user interaction after receiving the CTRL_LOGOFF_EVENT. Windows will powerdown 10 seconds after the event is broadcast.
WM_EMACS_KILL seems ok to use here, it is not used anywhere else as far as I can see. It is passed on and shows up in w32_msg_pump. There I am trying to use my_post_msg to pass it to the lisp thread.Wy not post it directly to the lisp thread in the first place?
Just because I am not sure about how to do that ;-)Please tell me how to do that. Can I use post_msg / my_post_msg or something similar? Code is greatly appreciated!
[Prev in Thread] | Current Thread | [Next in Thread] |