Re: why this API (SetSystemPowerState) can not change the system power state??



Hi, Michel

Thank you very much for your response and advice.

My OS version is wince 5.0. And my system will get into useridle mode if we
don't operate my CE device after one or more minutes, the backlight of my CE
device will turn dark too. so if I plug in the usb cable and charge the
battery or communicate with the PC, I want to move the system out of
useridle into on and turn on the backlight.

so if I got the usb plug in evnet in my usb driver programe, I will call
this API and change the system power state from useridle into on, but it
does not work, the system power state still keep in useridle mode, and the
backlight still keep its old state too. most importantly, I can not get the
PBT_TRANSITION notification from the PM. That puzzles me greatly.

--


Michel Verhagen (eMVP)" <michel@xxxxxxxxxx>
??????:%237vM22FoIHA.5096@xxxxxxxxxxxxxxxxxxxxxxx
Because the power manager decides what is best for the system, not some
random application. Note that *you* control the behavior of the power
manager!

Can you tell us *why* you want to move the system out of useridle into on?

In your case you should modify the PM pdd and implement a scheme that
makes sense for your system instead of trying to work against the PM with
your appplication. Take a look at
\WINCE600\PUBLIC\COMMON\OAK\DRIVERS\PM\PDD\DEFAULT to gain a better
understanding of how the PM works. The code is very well documented and
quite easy to understand.

Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Hzh wrote:
Does anyone can tell me why?

My system power state is in useridle mode, when I got an event in my
driver under CE 5.0, I want to change the system power state from
useridle to on, so I call this API, SetSystemPowerState(L"on",0,0); but
it does not work, the system power state still keep in useridle mode, and
I could not get the PBT_TRANSITION notification either. It seems that my
system could not broadcast the PBT_TRANSITION notification.

Anyone can give me some advice? Thank you all very much.

Ricky



.



Relevant Pages

  • Re: why this API (SetSystemPowerState) can not change the system power state??
    ... Open the named event "PowerManager/ActivityTimer/UserActivity" and set it whenever you want to transition to "on". ... It's all in the registry and the code, and as I said, not difficult to find: ... And my system will get into useridle mode if we don't operate my CE device after one or more minutes, the backlight of my CE device will turn dark too. ... so if I got the usb plug in evnet in my usb driver programe, I will call this API and change the system power state from useridle into on, but it does not work, the system power state still keep in useridle mode, and the backlight still keep its old state too. ...
    (microsoft.public.windowsce.embedded)
  • Re: why this API (SetSystemPowerState) can not change the system power state??
    ... Because the power manager decides what is best for the system, ... My system power state is in useridle mode, when I got an event in my driver under CE 5.0, I want to change the system power state from useridle to on, so I call this API, SetSystemPowerState; but it does not work, the system power state still keep in useridle mode, and I could not get the PBT_TRANSITION notification either. ... It seems that my system could not broadcast the PBT_TRANSITION notification. ...
    (microsoft.public.windowsce.embedded)
  • why this API (SetSystemPowerState) can not change the system power state??
    ... My system power state is in useridle mode, when I got an event in my driver ... PBT_TRANSITION notification either. ...
    (microsoft.public.windowsce.embedded)