Power off detection

  • Thread starter Thread starter Moshe Peleg
  • Start date Start date
M

Moshe Peleg

Hi,

From what I've read in teh forum, there is no way to get a warning that the
power off was clicked (on most pda's).
Is there a "human" ;-) way to figure out that the system was turned on?

There is an event I must perform on system powerup.
Currently I'm running a special thread that check if more than 1 second
passed since last check ...

This is like scratching your left ear with your right arm.

Thanks,

MP.
 
There are two notifications that you can use - one from the system
notifications, and one from the power manager. The Smart Device Framework
has them both wrapped into managed events (in the
OpenNETCF.WindowsCE.DeviceManagement and PowerManagement classes IIRC). The
other option is to hook them yourslef with P/Invokes - code for both should
be available (though most likely in C) on the web.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Back
Top