How to detect windows shutdown

vincent wehren vincent at visualtrans.de
Thu Apr 7 14:27:46 EDT 2005


"Austin" <austin at maxtronic.com.tw> schrieb im Newsbeitrag 
news:d32h4q$ifh$1 at netnews.hinet.net...
|I wrote a GUI program with wxPython.
| The error message is:
|
| Unhandled exception
| An unhandled exception occured. Press "Abort" to terminate the program,
| "Retry" to exit the program normally and "Ignore" to try to continue.
|
| Actually, besides the main program, there is another thread running
| background.
|
|
|
|
| > 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

Does this problem also occur when you "manually" exit the program (provided
you have a function to do so)?

If so, make sure you do something like self.tbicon.Destroy() -- with
self.tbicon being your instance of wx.TaskBarIcon() -- in your
event handler bound to wx.EVT_CLOSE.

HTH,

--

Vincent Wehren







More information about the Python-list mailing list