"Bandu" <m.*****@gmail.comwrote in message
news:50**********************************@k39g2000 hsf.googlegroups.com...
Hi,
I used SystemEvents.PowerModeChanged to monitor from WinForm
application and it work fine.
I put that code in to Windows service application and it not seem to
catch any power event.
Help please? How can I monitor power change event from service
application?
Regards,
Bandu
PowerModeChanged events (like all other System event notifications) are not
dispatched to Windows Services.
You should have received an Exception when attaching the handler for this
event, please consult the SystemEvents docs in MSDN for details.
What you can do is use System.Management.ManagementEventWatcher and register
an Win32_PowerManagementEvent event handler, this works for all type of
applications in Windows.
Willy.