[Windows Mobile Apps and Games] elektro255:
Backlight control

I made simple application for those who want change backlight setting acording to profile.

To use application :

0. Backup HKCU\ControlPanel\Backlight registry keys

1. Copy file to \BLCONF.exe

2. go to CHTSheduler settings->profile->Execute App(s)

3. In first line enter "\BLCONF.exe"

4. In second line enter pairs of attribute-value examples below

5. Click to Add to #x

6. All done :)

usage: BLCONF.exe name value [name2] [value2] ... [name_n] [value_n]

As parameters you use pairs of name of record in registry and desired value.

Examples:

\BLCONF.exe Brightness 10 (set brighness to 10 on battery)

\BLCONF.exe Brightness 1 ACBrightness 10 ACTimeout 60 (set brightness to 1 on battery 10 when pluged to charger and timeout on charger to 60)

BE CAREFUL ! Setting values out bound can make unpredictible behavior.

Application changes values and then sends BackLightChangeEvent to OS.

Some parameters description:

"BatteryTimeout"=dword:00000001E <----- This value changes the time (in seconds) that the back light goes from on state to its Light Sensor determined "screen on" power save state. this does not affect the wake to sleep/standby time period. ("screen on", power save state, dims the display while keeping it on and viewable to the user, the step before it fully goes to sleep/stand by)

"ACTimeout"=dword:0000003C <----- Same as above just for A/C Power (plugged In)

"DimBKLinUnlockScreen"=dword:00000001 <----- This Dword allows you to adjust the back light state from dimmed or normal in the Key lock unlock screen. "1" for on state, "0" for off state.

"LightDetectOn"=dword:00000001 <----- This value turns on or off the ability for the sight sensor to put the screen in to a light sensor determined, "screen on", power save state. ("screen on", power save state, dims the display while keeping it on and viewable to the user, the step before it fully goes to sleep/stand by)

"BrightNess"=dword:00000002 <----- This is the "on battery power" screen brightness option in the "Power" options located in the control panel. Note: light sensor has to be disabled to allow these settings to take affect or change with the controlpanel slider bar.

"LightSensorToScreenOff"=dword:00000005 <----- this is the the option that puts the touch screen to sleep when you put the phone to you ear. it doesnt seem to work though.

"LightSensorThreshold"=dword:00000005 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"LightSensorInterval"=dword:000000C8 <----- The rate (in miliseconds) at which the sensor polls the light conditions around the device.

"LightSensorPollingEnable"=dword:00000001 <----- this basically does what it says, it allows the sensor to check lighting conditions so it can adjust screen brightness accordingly.

"ACBrightNess"=dword:00000005 <----- This is the "on external power" screen brightness option in the "Power" options located in the control panel.
Note: light sensor has to be disabled to allow these settings to take affect or change with the controlpanel slider bar.

"ACBacklightOnTap"=dword:00000001 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"BacklightOnTap"=dword:00000001 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"ExtOnOff"=dword:00000001 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"OnOff"=dword:00000001 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"LSensorReduceBKLDelay"=dword:00000005 <----- I dont know what this does, if you do please tell

"LSensorAvegQuene"=dword:00000003 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"MAXBrightnessScale"=dword:0000000A <----- is is the max value the light sensor will be able to acheive for screen brightness. 1 - 10, 1 being lowest and 10 being max brighness.

"MINBrightnessScale"=dword:00000001 <----- same as the above but backwards, obviously.

"AutoSensor"=dword:00000001 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"QKeyLedTimeout"=dword:0000000A <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"BatteryTimeoutUnchecked"=dword:00000000 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"BatteryTimeoutTemp"=dword:00000000 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"ACTimeoutUnchecked"=dword:00000000 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

"ACTimeoutTemp"=dword:00000000 <----- i couldnt tell a change when playing with this value. if you know what this does, if you do please tell

Source code:

int _tmain(int argc, _TCHAR* argv[])
{
HKEY hKey = NULL;
DWORD dwDisposition = 0;
RegCreateKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"),0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
for(int i = 1;i<argc;i+=2)
{
int value = _wtoi(argv[i+1]);
RegSetValueEx(hKey, argv[i], 0, REG_DWORD, (PBYTE) &value, sizeof(REG_DWORD));
}
HANDLE hBackLightEvent = CreateEvent( NULL, FALSE, TRUE, TEXT("BackLightChangeEvent"));
SetEvent(hBackLightEvent);
CloseHandle(hBackLightEvent);
return 0;
}