468,301 Members | 1,462 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

Detect windows shutdown

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
2 3367
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
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.

Similar topics

2 posts views Thread by Austin | last post: by
6 posts views Thread by Adnan Hebibovic | last post: by
8 posts views Thread by Bill Sonia | last post: by
reply views Thread by jerry.xuddd | last post: by
2 posts views Thread by Mike Stephens | last post: by
13 posts views Thread by Shailesh Humbad | last post: by
4 posts views Thread by Chris Johnson | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.