469,271 Members | 1,366 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to detect windows shutdown

I wrote a program running on windows.
I put the link of the program in "Start up" folder and let it executed
minimized.
Every time when I open the computer, my program will be running in system
tray.

But if the user would like to shutdown the computer, the OS will show an
error about exception.

At first, I think windows will terminate all processes when it shutdown.
So, if python has the way to dectect shutdown process, I can kill the
process in advance.

Thanks a lot.
Jul 18 '05 #1
2 3982
Programs that start at boot, run until shutdown and run in
background all the time under Windows are good candidates
for being turned into Windows Services. They respond to
shutdown commands properly and can be fine-grained scheduled
as well. For tutorial pick of a copy of Python Programming
on Win32 (Hammond and Robinson) and use Mark Hammonds Python
Windows extension library.

Larry Bates
Austin wrote:
I wrote a program running on windows.
I put the link of the program in "Start up" folder and let it executed
minimized.
Every time when I open the computer, my program will be running in system
tray.

But if the user would like to shutdown the computer, the OS will show an
error about exception.

At first, I think windows will terminate all processes when it shutdown.
So, if python has the way to dectect shutdown process, I can kill the
process in advance.

Thanks a lot.

Jul 18 '05 #2
Austin wrote:
I wrote a program running on windows.
I put the link of the program in "Start up" folder and let it executed
minimized.
Every time when I open the computer, my program will be running in system
tray.

But if the user would like to shutdown the computer, the OS will show an
error about exception.


Important missing information: is this a GUI program or
a console program, and if it's a GUI program, what framework
did you use to write it (wxPython, PyQt, other...)? Also,
what is the exception that you got? (Always report the
specific error: we can't guess what exception you got,
and the answer could well point directly to a cause that
is different than you think it is.)

-Peter
Jul 18 '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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.