For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > April 2006 > RE: Treo w700 Power Managment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: Treo w700 Power Managment
Kevin FL

2006-04-13, 8:04 am

Sam -

I am running into the exact same situation, did you ever get anything
figured out with this?

"Sam" wrote:

> Hello,
>
> I have an media player application that comes up at certain time and play
> mp3 file. I use SystemIdleTimerReset to prevent the Treo from going to
> suspend mode. It works find if the KeyGuard is not Active. However, if the
> application starts from sleep mode and the Keyaguard mode is on, then
> SystemIdleTimerReset does not work and the device suspend after specific
> time.
>
> Can someone shed some light on this problem and what is the work around? I
> know there must be a way because Active sync does ot and prevents the device
> from suspending.even the keyguard is on.
>
>
> Your help is greatly appreciated...
>
>
>

Yaroslav Goncharov

2006-04-13, 8:04 am

There are two events that can suspend your Pocket PC:
1. Idle timer timeout. You need to call SystemIdleTimerReset often enough to
prevent device from suspending.
2. Power button. Resetting the idle timer does not prevent device from
suspending when user clicks a power button (or when it is done
programatically). To prevent device from suspending in this case you need to
enter the unattended mode:
PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE);

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


"Kevin FL" <KevinFL@discussions.microsoft.com> wrote in message
news:B45167A5-83ED-44F5-B628-6A93CA5E1E77@microsoft.com...[color=darkred]
> Sam -
>
> I am running into the exact same situation, did you ever get anything
> figured out with this?
>
> "Sam" wrote:
>


riki

2006-04-14, 4:09 am

Kevin FL wrote:
> Sam -
>
> I am running into the exact same situation, did you ever get anything
> figured out with this?



try:

SetPowerRequirement()
(especially with device "BKL1:"

SetSystemPowerState()
might also do what your after.

riki

----
When asked if I am ignorant or apathetic I answer, "I don't know and I
really don't care."
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
Latest Betas have WM5 layout and speed dial support
Kevin FL

2006-04-19, 7:07 pm

Thank you Yaroslave -

The "SystemIdleTimerReset" was my original solution and this seemed to work
fine on most devices, but get's ignored on the Treo w/ the keyguard on...

When I implemented the PowerPolicyNotify in your second suggestion, this
appeared to keep my device from going back to sleep

Thanks again!

"Yaroslav Goncharov" wrote:

> There are two events that can suspend your Pocket PC:
> 1. Idle timer timeout. You need to call SystemIdleTimerReset often enough to
> prevent device from suspending.
> 2. Power button. Resetting the idle timer does not prevent device from
> suspending when user clicks a power button (or when it is done
> programatically). To prevent device from suspending in this case you need to
> enter the unattended mode:
> PowerPolicyNotify(PPN_UNATTENDEDMODE, TRUE);
>
> --
> Yaroslav Goncharov
> Spb Software House, http://spbsoftwarehouse.com
> Pocket PC Developer Network, http://pocketpcdn.com
>
>
> "Kevin FL" <KevinFL@discussions.microsoft.com> wrote in message
> news:B45167A5-83ED-44F5-B628-6A93CA5E1E77@microsoft.com...
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com