Re: How detect that Windows is shutting down?

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu