detecting power on

  • Thread starter Thread starter Mortar
  • Start date Start date
M

Mortar

ok, i know how to run an app on power on with cerunappatevent. But, i
would like to know if i have an app already running, how do i call a
function if they power on.

So for example, the program is running, they turn the pda off, then
they turn the pda on again. I need to do something when they turn it
on again, but not run an app, just call a function.
 
Use a power notification. CeRunAppAtEvent can also set a system event.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
well here is my code to run my app on power up:
bool bRet = CeRunAppAtEvent(@"\Program Files\myapp\myprogram.exe",
NOTIFICATION_EVENT_WAKEUP)

how would i change it to call a function?
 
ive tried that link several times and it always times out


Alex Feinman has written an example which demonstrates how to receive
power notifications and display a login dialog when the system is woken up:
http://www.alexfeinman.com/download.asp?doc=PowerAwareApp.zip


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

ok, i know how to run an app on power on with cerunappatevent. But, i
would like to know if i have an app already running, how do i call a
function if they power on.

So for example, the program is running, they turn the pda off, then
they turn the pda on again. I need to do something when they turn it
on again, but not run an app, just call a function.
 
Change the program name to "\\\\.\\Notifications\\NamedEvents\\Event Name".
Of course you'll have to create a EventWaitHandle with an explicit name that
matches the "Event Name". It will get signalled on wake.

The other option is to follow Sergey's advice to look at Alex's sample.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
The web site is down for the next week or so. Email me

Mortar said:
ive tried that link several times and it always times out


Alex Feinman has written an example which demonstrates how to receive
power notifications and display a login dialog when the system is woken
up:
http://www.alexfeinman.com/download.asp?doc=PowerAwareApp.zip


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

ok, i know how to run an app on power on with cerunappatevent. But, i
would like to know if i have an app already running, how do i call a
function if they power on.

So for example, the program is running, they turn the pda off, then
they turn the pda on again. I need to do something when they turn it
on again, but not run an app, just call a function.
 
Back
Top