|
|
|
start date: Thu, 19 Jul 2007 18:44:15 +0300,
posted on: microsoft.public.dotnet.framework.compactframework
back
| Thread Index |
|
1
Moshe Peleg
|
|
2
ctacke/ ctacke[at]opennetcf[dot]com
|
Power off detection
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.
Date:Thu, 19 Jul 2007 18:44:15 +0300
Author:
|
Re: Power off detection
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
"Moshe Peleg" wrote in message
news:%23mzUquhyHHA.3940@TK2MSFTNGP05.phx.gbl...
> 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.
>
>
Date:Thu, 19 Jul 2007 10:49:49 -0500
Author:
|
|
|