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

How to detect windows shutdown

P: n/a
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
Share this Question
Share on Google+
2 Replies


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

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