What is the best way to detect when Windows power state is changing?
I need to preform some actions depending on whether the computer is going to Standby/Hibernate/Shut Down
See Question&Answers more detail:osWhat is the best way to detect when Windows power state is changing?
I need to preform some actions depending on whether the computer is going to Standby/Hibernate/Shut Down
See Question&Answers more detail:osThe SystemEvents.PowerModeChanged
event should do what you want
You might also want to check out the SystemInformation.PowerStatus
property.