|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Detecting Battery Backup NotificationI am setting up a couple of servers for an internal beta test of a web app.
I want to implement a feature that would tell logged in users to log out should a power failure occur (and the servers are running on UPS batteries). Assuming I configure the Power Options so that "Notifications" are broadcast, how do I detect those notifications in my web app? I have search high and low for what these "Notifications" are but cannot find anything. Coding4Fun had a recent article about being "Power-aware" titled "You Can
Take It With You, Part 1" [1] That article basically details how to use the SystemEvents.PowerModeChanged [2]event. [1] http://msdn.microsoft.com/coding4fun/inthebox/mobile1/default.aspx [2] http://msdn2.microsoft.com/en-us/library/microsoft.win32.systemevents.powermodechanged.aspx Show quote "EmmanuelE" wrote: > I am setting up a couple of servers for an internal beta test of a web app. > I want to implement a feature that would tell logged in users to log out > should a power failure occur (and the servers are running on UPS batteries). > > Assuming I configure the Power Options so that "Notifications" are > broadcast, how do I detect those notifications in my web app? I have search > high and low for what these "Notifications" are but cannot find anything. > > I'm reading the MSDN help now (that's always an interesting exercise isn't
it!) to figure out how to write a user space service that will listen for power change system events. The article was very helpful. Thanks! I think I'm on my way to figuring this all out. Show quote "Peter Ritchie [C# MVP]" wrote: > Coding4Fun had a recent article about being "Power-aware" titled "You Can > Take It With You, Part 1" [1] > > That article basically details how to use the SystemEvents.PowerModeChanged > [2]event. > > [1] http://msdn.microsoft.com/coding4fun/inthebox/mobile1/default.aspx > [2] > http://msdn2.microsoft.com/en-us/library/microsoft.win32.systemevents.powermodechanged.aspx > > -- > http://www.peterRitchie.com/blog/ > Microsoft MVP, Visual Developer - Visual C# > > > "EmmanuelE" wrote: > > > I am setting up a couple of servers for an internal beta test of a web app. > > I want to implement a feature that would tell logged in users to log out > > should a power failure occur (and the servers are running on UPS batteries). > > > > Assuming I configure the Power Options so that "Notifications" are > > broadcast, how do I detect those notifications in my web app? I have search > > high and low for what these "Notifications" are but cannot find anything. > > > > Good to hear. I didn't find the PowerModeChanged event docs very detailed.
The article is a good adjunct. -- Show quoteBrowse http://connect.microsoft.com/VisualStudio/feedback/ and vote. http://www.peterRitchie.com/blog/ Microsoft MVP, Visual Developer - Visual C# "EmmanuelE" wrote: > I'm reading the MSDN help now (that's always an interesting exercise isn't > it!) to figure out how to write a user space service that will listen for > power change system events. > > The article was very helpful. > > Thanks! I think I'm on my way to figuring this all out. > > "Peter Ritchie [C# MVP]" wrote: > > > Coding4Fun had a recent article about being "Power-aware" titled "You Can > > Take It With You, Part 1" [1] > > > > That article basically details how to use the SystemEvents.PowerModeChanged > > [2]event. > > > > [1] http://msdn.microsoft.com/coding4fun/inthebox/mobile1/default.aspx > > [2] > > http://msdn2.microsoft.com/en-us/library/microsoft.win32.systemevents.powermodechanged.aspx > > > > -- > > http://www.peterRitchie.com/blog/ > > Microsoft MVP, Visual Developer - Visual C# > > > > > > "EmmanuelE" wrote: > > > > > I am setting up a couple of servers for an internal beta test of a web app. > > > I want to implement a feature that would tell logged in users to log out > > > should a power failure occur (and the servers are running on UPS batteries). > > > > > > Assuming I configure the Power Options so that "Notifications" are > > > broadcast, how do I detect those notifications in my web app? I have search > > > high and low for what these "Notifications" are but cannot find anything. > > > > > > |
|||||||||||||||||||||||