2

Possible Duplicate:
detect power state change

In my c# windows form application I want to reset a counter variable upon system wake up from hibernate/sleep. Is there any methods or events exists for detecting this?

Community
  • 1
  • 1
Sreejith G
  • 211
  • 5
  • 14
  • Have you looked to see if the system state is exposed in the Win32 library? You are going to have to keep track of it if it is. – Security Hound Jun 26 '12 at 11:50

1 Answers1

4

The .NET Framework provides a PowerModeChanged event that occurs whenever there is a change in power status, such as when a user suspends or resumes the operating system.

David Brabant
  • 41,623
  • 16
  • 83
  • 111