473,395 Members | 1,678 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,395 software developers and data experts.

Shuting down, killing services and WM_DESTROY

We have an application that is supposed to run as a service. When someone shuts down the computer, the app is supposed to save the contents of the screen into a file so it can be loaded back up when the computer comes back on.

So my question is, does shuting down the computer send a WM_DESTROY message to the program if it is being run as a service? If not, why not?

Thanks!
Feb 28 '08 #1
5 1854
RedSon
5,000 Expert 4TB
We have an application that is supposed to run as a service. When someone shuts down the computer, the app is supposed to save the contents of the screen into a file so it can be loaded back up when the computer comes back on.

So my question is, does shuting down the computer send a WM_DESTROY message to the program if it is being run as a service? If not, why not?

Thanks!
I think all applications are asked by the OS to close when the computer is shutting down. So that means that the application would get the same messages as if a user had clicked on the little X button.
Feb 28 '08 #2
Well, we've tested it, and if we close the app via the X, then the message gets sent as it should. But if we shut the computer down while the service is still running, then it doesn't get sent.

Any thoughts?
Mar 3 '08 #3
RedSon
5,000 Expert 4TB
Well, we've tested it, and if we close the app via the X, then the message gets sent as it should. But if we shut the computer down while the service is still running, then it doesn't get sent.

Any thoughts?
Subscribe to power management events?
Mar 3 '08 #4
Well, that's part of my question. What messages get sent to the app if the power button is hit? Does WM_POWERBROADCAST get sent?
Mar 3 '08 #5
RedSon
5,000 Expert 4TB
Well, that's part of my question. What messages get sent to the app if the power button is hit? Does WM_POWERBROADCAST get sent?
On mobile devices it does. I would think that the XP powermanager would be more advanced the mobile devices, so you probably want to read up on MSDN for that message.
Mar 3 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tim Marshall | last post by:
I'm having a vexing problem with using filecopy and compactdatabase on a Jet back end I'm sure I did not have with A97. It seems to me that A2003 is much slower in shutting down the back end ldb...
0
by: Rajko | last post by:
How come I don't get WM_DESTROY message when I call CDialog::OnOK()? CDialog::OnOK() calls EndModalLoop() and EndDialog(); But there is no WM_DESTROY, which I need to end thread. BTW I dont want...
4
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding, and if not...
1
by: Sebouh | last post by:
Hi guys. I''m curious about what happens when windows shuts down. I have a program running that saves data into a file when the form's closing method is invoked. So when Windows shuts down, does...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.