detecting UPS activation
Eric Strain <eric_strain1-/[email protected]>
| Newsgroups | gmane.comp.windows.off-topic |
|---|---|
| Message-ID | <[email protected]> |
Hi All, Is there a way to programatically detect when the Uninterruptable Power Supply or battery backup kicks on? Such as when the power fails and the battery or backup generator kicks in. I've tried using the GetSystemPowerStatus( ) to detect when the ACLineStatus changes but when I unplug my battery backup from the wall and have the machine running from the battery those functions report that the system is still running on AC. What I need is an event handler or function that will fire as soon as the power source for the machine changes. I've also tried using the WM_POWERBROADCAST event message to flag when the power source changes but that didn't work either. I'm looking for something written in C++ that I can incorporate into my project. Any ideas? In the mean time, I'll keep looking. Thanks guys. -Eric