Quote: Originally Posted by bcrain
Just upgraded to Windows 7. This problem arises, which I didn't have in XP: I run a program (one that I've developed) that does a huge number of numerical calculations. To reach its conclusion and give the answer takes hours and hours. Best to start it before bedtime, hoping to have the answer in the morning. But Windows 7 goes into some kind of quasi-shut down mode; in the morning I see only the Intro screen where I choose the User, etc. Clicking it returns the desktop, and the program I had running all night is there, but it is frozen, with a blank screen. At the top it says something like "Program not responding." Can't find any way to revive it and show me the answer (or continue calculating, if it's not finished). I have to go to task manager and end it, losing all that overnight work. What can I do to fix that?
Sounds like Windows 7 decided your program was locked up and then went into standby...
Since this is your own code... you need to capture the WM_POWERBROADCAST
message and respond with the DENY value to prevent system standby while your calculations are running.
Also, if you are using tight loops to do your calculations, you should imbed Sleep(0)
calls in the parts of the loops that are not being timed by interprocess or interthread signals. The goal is to periodically release a time slice so the system doesn't see your program as being unresponsive.
The system natively uses only keyboard, mouse and network activity to reset the standby counters... applications that must prevent standby need to do it by the message method...