Question
How Do I Programmatically Turn Pocket PC or CE. NET Display Backlight On and Off?
Article ID: 23888373
Facts
Answer
Use the code below to programmatically turn the display backlight on and off:
CEDEVICE_POWER_STATE DeviceStateOn = {D0};
CEDEVICE_POWER_STATE DeviceStateSleep = {D3};
CEDEVICE_POWER_STATE DeviceStateOff = {D4};
void BacklightOn( void )
{
CEDEVICE_POWER_STATE CurrentState = DeviceStateOff;
GetDevicePower( TEXT("BKL1:"), POWER_NAME, &CurrentState );
if ( CurrentState != DeviceStateOn )
DevicePowerNotify( TEXT("BKL1:"), DeviceStateOn, POWER_NAME );
}
void BacklightOff( void )
{
CEDEVICE_POWER_STATE CurrentState = DeviceStateOff;
GetDevicePower( TEXT("BKL1:"), POWER_NAME, &CurrentState );
if ( CurrentState != DeviceStateOff )
DevicePowerNotify( TEXT("BKL1:"), DeviceStateOff, POWER_NAME );
}
void BacklightSleep( void )
{
CEDEVICE_POWER_STATE CurrentState = DeviceStateOff;
GetDevicePower( TEXT("BKL1:"), POWER_NAME, &CurrentState );
if ( CurrentState != DeviceStateSleep )
- }
#include<Pm.h>
