OK that does it. For the umpteenth time my laptop just shut down in the middle of my game because my power cable had disconnected without me noticing it.
Now I want to write a little C# program that detects when my power cable disconnects and then emits a nice long System beep. What API could I use for that?