none
windows mobile上如何获取键盘灯是否打开的信息呢 RRS feed

答案

  • Hi,

    你可以尝试一下 GetDevicePower 方法,他能够返回一个 CEDEVICE_POWER_STATE 状态,有以下几种情况:

    D0
    Full On. This is the state in which the device is on and running. It is receiving full power from the system and is delivering full functionality to the user.
    D1
    Low On. This is the state in which the device is fully functional at a lower power state than D0, a lower performance state than D0, or both. This state is applicable when the device is being used, but where peak performance is unnecessary and power is at a premium.
    D2
    Standby. This is the state in which the device is partially powered with automatic wakeup on request. The device is effectively standing by.
    D3
    Sleep. This is the state in which the device is partially powered with device-initiated wakeup if available. A device in state D3 is sleeping but capable of raising the System Power State on its own. It consumes only enough power to be able to do so; which must be less than or equal to the amount of power used in state D2.
    D4
    Off. This is the state in which the device is not powered. A device in state D4 should not be consuming any significant power. Some peripheral busses require static terminations that intrinsically use non-zero power when a device is physically connected to the bus; a device on such a bus can still support D4.


    其中,D2,D3,D4 可以说明当前的键盘背景灯是否出去打开状态.

    Thanks.

    Microsoft Online Community Support Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    2009年7月6日 3:50
    版主

全部回复

  • Hi,

    你可以尝试一下 GetDevicePower 方法,他能够返回一个 CEDEVICE_POWER_STATE 状态,有以下几种情况:

    D0
    Full On. This is the state in which the device is on and running. It is receiving full power from the system and is delivering full functionality to the user.
    D1
    Low On. This is the state in which the device is fully functional at a lower power state than D0, a lower performance state than D0, or both. This state is applicable when the device is being used, but where peak performance is unnecessary and power is at a premium.
    D2
    Standby. This is the state in which the device is partially powered with automatic wakeup on request. The device is effectively standing by.
    D3
    Sleep. This is the state in which the device is partially powered with device-initiated wakeup if available. A device in state D3 is sleeping but capable of raising the System Power State on its own. It consumes only enough power to be able to do so; which must be less than or equal to the amount of power used in state D2.
    D4
    Off. This is the state in which the device is not powered. A device in state D4 should not be consuming any significant power. Some peripheral busses require static terminations that intrinsically use non-zero power when a device is physically connected to the bus; a device on such a bus can still support D4.


    其中,D2,D3,D4 可以说明当前的键盘背景灯是否出去打开状态.

    Thanks.

    Microsoft Online Community Support Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    2009年7月6日 3:50
    版主
  • CEDEVICE_POWER_STATE  powerState;
     GetDevicePower("BKL1:",POWER_NAME,&powerState);
    我使用这两句,得到的state总是9,不晓得为什么,怎么样得到键盘灯的设备名呢。这个对不对
    2009年7月9日 2:15
  • CEDEVICE_POWER_STATE  powerState;
     GetDevicePower(_T("BKL1:"),POWER_NAME,&powerState);
    貌似得到的是背光灯的状态
    不是键盘灯的

    另外几个状态都是什么意思
    2009年7月9日 2:57
  • 第一个参数指定了应用程序需要维护电源状态的设备。DeviceState参数定义了设备的电源状态。CEDEVICE_POWER_STATE指定了状态范围是从D0(意味着设备是处于最大功耗状态)到D4(表示设备被关闭)(译者注:其实D0到D4的状态的具体表现,完全是由OEM厂商可自定义的,对应用程序开发者来说,比如是在D1关LCD背光还是在D2,都是不确定的,微软只给出标准定义,而不是实际定义)。DeviceFlags参数由两个标志合并而成:POWER_NAME,表示设备名有效;POWER_FORCE,表示设备应当维持当前状态甚至当系统挂起时。如果pvSystemState不为NULL,它表示只有对于在pvSystemState中已命名的电源请求才是有效的。设备可能无法更改请求的状态
    2009年7月9日 3:16