Is there any way to intercept the event of the physical power button being pressed in order to react to this event? i.e.:
Push button -> My program catche
You could use SystemEvents.SessionEnding Event
However I am not sure if this will work if the power button is pressed, this event Occurs when the user is trying to log off or shut down the system.