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.
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.powermodec
hanged.aspx

Signature
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
> 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
[quoted text clipped - 3 lines]
> 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.
EmmanuelE - 26 Jul 2006 21:55 GMT
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.
> Coding4Fun had a recent article about being "Power-aware" titled "You Can
> Take It With You, Part 1" [1]
[quoted text clipped - 13 lines]
> > 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.
Peter Ritchie [C# MVP] - 26 Jul 2006 22:05 GMT
Good to hear. I didn't find the PowerModeChanged event docs very detailed.
The article is a good adjunct.

Signature
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
> 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
[quoted text clipped - 21 lines]
> > > 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.