Home All Groups Group Topic Archive Search About

Detecting Battery Backup Notification

Author
25 Jul 2006 10:25 PM
EmmanuelE
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.

Author
26 Jul 2006 8:22 PM
Peter Ritchie [C# MVP]
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#


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.
>
>
Author
26 Jul 2006 8:55 PM
EmmanuelE
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.
> >
> >
Author
26 Jul 2006 9:05 PM
Peter Ritchie [C# MVP]
Good to hear.  I didn't find the PowerModeChanged event docs very detailed. 
The article is a good adjunct.

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


Show quote
"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.
> > >
> > >

AddThis Social Bookmark Button