473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3752
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Austin | last post by:
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...
6
by: Adnan Hebibovic | last post by:
Hello developers How can I detect Windows shutdown from .NET and I mean clean .NET not catching the events with Win32 API ... Thanks
8
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my...
0
by: jerry.xuddd | last post by:
I believe that someone asked the same question before, but I can't find the old post. I have written a windows service that needs to perform different functions between a user is logged in and...
2
by: Mike Stephens | last post by:
I have an application to minimizes when X is clicked. If the user wants to close the application they click the Exit Application button.This works fine and does exactly what I need. I have since...
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
13
by: Shailesh Humbad | last post by:
Here is an advanced PHP question. Can anyone think of a way to detect the number of bytes written to output when a script is aborted? I am sending a large file to the client, and I want to record...
4
by: Chris Johnson | last post by:
Hey all, I have a small app I have developed that periodically pings a list of server and returns their status. Given my environment I have setup the program such that a server can be down 4...
2
by: Jason S | last post by:
Hi there, I created a simple VB app that runs in the background that I now need to detect when Windows (XP with SP2) is just about to Shut Down OR the user is Logging Off. Is this possible? I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.