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:

; This registry setting tells GWES to signal the Power Manager
; when user input devices are active. GWES will reset this activity timer
; whenever it dequeues any type of input event (keyboard, mouse, or
; touch) from its internal queue.
[HKEY_LOCAL_MACHINE\SYSTEM\GWE]
"ActivityEvent"="PowerManager/ActivityTimer/UserActivity"



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:
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.

.



Relevant Pages

  • RE: UserActivity setting in registry
    ... The activity timer registry settings control how long it takes for the ... I think that the registry settings you want are the ones below. ... Default System Power State Transition Timeouts ... Once the UserActivity timer expires, the PM will transition to the ...
    (microsoft.public.windowsce.embedded)
  • Re: Problems with Suspend to Ram and MCE 2005
    ... Description of how to enable the S3 system power state for standby when USB ... Important This article contains information about modifying the registry. ... >> The computer will actually suspend but the fans keep running (the BIOS ... >> changed or updated the BIOS since the MCE 2005 install). ...
    (microsoft.public.windows.mediacenter)
  • Re: why this API (SetSystemPowerState) can not change the system power state??
    ... And my system will get into useridle mode if we ... so if I got the usb plug in evnet in my usb driver programe, ... does not work, the system power state still keep in useridle mode, and the ... I could not get the PBT_TRANSITION notification either. ...
    (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)