By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

Detect windows shutdown

P: n/a
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.
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 6/22/05, Austin <au****@maxtronic.com.tw> wrote:
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
Jul 19 '05 #2

P: n/a
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

On 6/22/05, Konstantin Veretennicov <kv***********@gmail.com> wrote:
On 6/22/05, Austin <au****@maxtronic.com.tw> wrote:
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
--
http://mail.python.org/mailman/listinfo/python-list

--
Christopher Lambacher
la******@computer.org
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.