Detecting Hybernation
-
I am writing a WPF application which shows video content. The PC will run 24 hours a day and is protected from power loss by a UPS. If the mains power goes down for over a minute, the UPS software sends the PC into hybernation. When the power is restored the PC resumes, however... The application which was showing the video now shows nothing (blank space). Is there a way of detecting the immanent hybernation in order to gracefully stop the videos, and restart them or the application when the PC resumes?
gmar
-
I am writing a WPF application which shows video content. The PC will run 24 hours a day and is protected from power loss by a UPS. If the mains power goes down for over a minute, the UPS software sends the PC into hybernation. When the power is restored the PC resumes, however... The application which was showing the video now shows nothing (blank space). Is there a way of detecting the immanent hybernation in order to gracefully stop the videos, and restart them or the application when the PC resumes?
gmar
Looking at
Microsoft.Win32.SystemEvents.PowerModeChanged
might help.xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." -
Looking at
Microsoft.Win32.SystemEvents.PowerModeChanged
might help.xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."Thank you that is definitely worth looking up.
gmar