Solved

detecting/waking up from low power state?

Posted on 2000-04-02
6
255 Views
Last Modified: 2013-12-03

This is a multi-part question:

1) If my app is running and processing WM_TIMER messages (say once every 5 seconds), and the machine goes in to a low power state, is my app still effectively running and processing the WM_TIMER messages?

2) How can I detect a low power state and have my application "wake up" the system from a low power state?

Thanks,

Don
0
Comment
Question by:dmetzler
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 2678218
>> is my app still effectively running and
>> processing the WM_TIMER messages?
All "normal" operation is suspended.  You app is running, but sort of "frozen in place" and will resume operation when the system is resumed.

continues
0
 
LVL 22

Expert Comment

by:nietod
ID: 2678227
>> How can I detect a low power state
The OS will send your application (ALL applications) a WM_POWER message with a PWR_SUSPENDREQUEST indication.   when the system resumes it sends a WM_POWER message with a PWR_SUSPENDRESUME indicato.  In some cases, it may not be able to send the PWR_SUSPENDREQUEST message and may just suspend the system.  In that case the WM_POWER Message will be sent when the system starts again, but the indication will be PWR_CRTICALRESUME

Let me know if you have any questions.
0
 

Author Comment

by:dmetzler
ID: 2678914

So is there any way for an application to wake up the system?

Thanks,

Don
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:dmetzler
ID: 2678916

And does the monitor power state work the same way as system power state?  If the monitor goes to low power mode, can a Win32 application restore monitor power?

Thanks,

Don
0
 
LVL 22

Expert Comment

by:nietod
ID: 2679708
>> So is there any way for an application to wake up the system?
No everything is "frozen".  the current state of the computer is (RAM, registers etc) is written to some sort of nonvolatile storage (hard disk) and then the cpu is shut down (a special type of shut down, so it does not initialize the same when it is started again, actually the difference is probably only in the way it is started, not shut down.)  So the CPU is not doing anything, not programs are actually running, they are suspended in place until the CPU is started up again.

Now you can prevent the shutdown.

Interestingly, I've been reading the VC documentation and it seems to say that is wrong.  There is an "OnNow" feature of some computers that woudl allow the sleeping system to periodically check for things to be done (essentually it wakes up the CPU periodically and then lets it go back to sleep, so bassicall what I said was right, its just that these computers wake up and go back to sleep again and agin)   The docs don't mention anything specially you have to do to use this feature.  But it appears that all that it does when it (temporarily) wakes up is run the task scheduler to activate apps that are waiting on waitable timers.  So you will not get activated if you are using a "windows timer" (WM_TIMER) you need to be using on of the "multimedia timers".  (You also need to be using a computer with this feature.)

Do you have VC?  this is explained under "Power Management Overview" in the VC help.
0
 

Author Comment

by:dmetzler
ID: 2680324

Yes - and thank you - I will look into this.

I have noticed that on one of my Win98 systems (laptop), that the scheduled ScanDisk can awake from a suspended state to do what it needs to do.  This confirms your note above.

Don
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now