I'm trying to get a legacy VB6/C++ application to work on Windows 7. The application can't handle "Windows 7 Sleep"; if Windows 7 is put to sleep and is woken up again then the application stops working.

I would be home free if I could close the application when Windows 7 goes to sleep and re-launch the application when Windows 7 is woken up again. (I don't need to store any state between application runs). Is there a way to do this?

link|improve this question

What do you mean by "stops working", does it crash? Can you include the crash dump in that case and show us the stack? – Tom Wijsman Apr 5 '11 at 14:25
feedback

migrated from stackoverflow.com Apr 5 '11 at 13:59

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

One option is to process OS events and the .NET equivalent is a PowerModeChanged event.

Another option is to schedule tasks with the Task Manager to trigger on the sleep and resume events...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.