Handling sudden power failures in an application running on the computer
with the power failure simply isn't possible. When the power fails the
computer will stop running and the application will receive no warning.
For cases where the power mode changes, as in computer being suspended
or shut down, you can use the following events on
Both of these can be raised in response to specific power events on the
computer. This may be what you are looking for