Re: How detect that Windows is shutting down?
- Posted by petelomax Aug 08, 2012
- 1468 views
sergelli said...
But to complete, how do I continue the shutdown, then that my program solve their tasks?
I vaguely remember dealing with this for Edita quite a few years ago. The relevant code (arwen not win32lib) I ended up with is:
elsif(msg = WM_ENDSESSION and wParam) or msg = WM_CLOSE then return saveAllFilesAndINI() elsif msg = WM_QUERYENDSESSION then if saveAllFilesAndINI() then return {0} end if end if
So it is not a question of "do you have enough time?", just do whatever you need to before returning.
HTH, Pete