Wednesday 25 July 2007

In the dark with backlights...

Nice easy one here, which is always useful...

On PPC/Smartphone if your app needs to keep the backlight on you can requst that the backlight driver is kept in a high power state (i.e. ON!)

// force backlight on
SetPowerRequirement(TEXT("BKL1:"), D0, POWER_NAME POWER_FORCE, NULL, 0);


On PPC you may need to keep the system alive as well else it'll go into suspend, but this'll work indefinately on smartphone.

Use ReleasePowerRequirement to return the backlight to system timeout control. Note unlike some SatNav software this is nicer than editing the control panel system settings...! ;)

2 comments:

Patrick O'Hara said...

Is there an API (for Windows CE 5.0) to change the backlight settings? If not where can I find the registry settings that are used?

GraemeW said...

You can look at the advanced display control panel applet to show how to change the registry entries to control backlight functionality under CE:

C:\wince420\PUBLIC\WCESHELLFE\OAK\CTLPNL\ADVBACKLIGHT