I have a car navigation application that has an option to disable the
OS auto-shutoff so that when it is being used for long periods without
any user input, it still continues to run, of course. However, there
is a problem when I "turn off" (suspend) the unit (using the power
button) while the application is running. Basically, if left in this
state, it appears that when the nightly "unattended" mode activates (to
update alarms and such, I believe), the unit never powers back off --
because the navigation app is still running and re-disables the
auto-shut-off -- even from the "unattended" state.

So, in the morning, the battery is either dead or much lower.

Is there any way to programmatically detect that the unit is on in
"unattended" mode for the nightly stuff? So that the navigation app
could be sure to NOT disable the auto-off?

Thanks for thoughts on this...

- John Goggan...

Re: Detect "unattended" mode? by Lao

Lao
Thu Apr 27 14:02:37 CDT 2006

Read Mike Calligaro's excellent post here. He shows how to use a thread
to listen to power state change notifications from the power manager.
http://blogs.msdn.com/windowsmobile/archive/2005/08/11/450591.aspx

Also some general stuff here:
http://search.blogger.com/?ie=UTF-8&ui=blg&bl_url=windowsmobilepro.blogspot.com&x=0&y=0&scoring=d&as_q=%22%5BPower%20Management%5D%22

---
Lao K
Windows Mobile Pocket PC Smartphone Programming Hints and Tips
http://windowsmobilepro.blogspot.com