Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Apr 5 '11 at 13:59

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

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
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...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .