Detect windows shutdown

A

Austin

My program is running on windows and it is wrritten by Python and wxPython,
built by py2exe.

If my program is executed minimized, and the user want to shutdown or
reboot.
Meanwhile, my program is running and it has several threads running, too.
The shutdown or reboot will cause a error of my program.
Is there any way to dectect windows shutdown or reboot?
If I detect the message of shutdown, I could close all threads of my
program.
 
K

Konstantin Veretennicov

My program is running on windows and it is wrritten by Python and wxPython, ....
Is there any way to dectect windows shutdown or reboot?

Will wx.EVT_END_SESSION or wx.EVT_QUERY_END_SESSION help?

- kv
 
C

Chris Lambacher

There is an event that win32 sends to each thread to tell it to shut
down. You can grab that with the win32all extension (I am not on
windows right now so I can't look it up in the documentation).

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top