Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
End Users
Pocket PCActiveSyncMultimediaEBooksWirelessSmartPhones
Developers
Windows MobileSmartPhonesWinCE ProgrammingVB for WinCEVC++ for WinCEPlatform BuilderTest Tools
PocketPC DirectoryFree SoftwareWeb Resources
Related Topics
PalmMobile PhonesMore Topics ...

Pocket PC Forum / Developers / Windows Mobile / September 2009

Tip: Looking for answers? Try searching our database.

Set the backlight level on external power

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trevor - 17 Sep 2009 22:19 GMT
Is there a documented way to set the backlight level while on external
power?

I wrote the following code for Windows Mobile 5, and it succeeded at setting
the backlight to medium.  On Windows Mobile 6, it appears as if they
increased the range to 90.  Setting the backlight to '3' on Windows Mobile 6
ends up setting the backlight to very low (3/90) while it would set the
backlight to medium on Windows Mobile 5 (3/5).

if (RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("ControlPanel\\BackLight"),
 0, 0, &hKey) == ERROR_SUCCESS)
{
 dwValue = 3; // 1-5, 5 = highest, 1 = lowest.
 RegSetValueEx(hKey, _T("ACBrightness"), 0, REG_DWORD,
  (CONST BYTE*)&dwValue, sizeof(DWORD));
 RegSetValueEx(hKey, _T("BattBrightness"), 0, REG_DWORD,
  (CONST BYTE*)&dwValue, sizeof(DWORD));
 RegCloseKey(hKey);
}

Is there a documented way to do this?  I know I can add a #ifdef (_WIN32_WCE
> 0x501) and set dwValue to 45 to achieve the same results for Windows
Mobile 6, but a documented way to do this would be preferred so I don't have
to change it every time Microsoft decides to change their implementation.
Bruce Jackson - 22 Sep 2009 14:26 GMT
The range for backlight from minimum to maximum is different for most
devices.
0-10 is the default that works on many devices, iPAQ is usually from
1-5, some newer device use from 0-255, and there are others with 0-127
or 0-100

Also the registry key can have different names - "Brightness",
"BattBrightness", "BattBacklightLevel", "LuminanceLevel" just to name
a few

After changing the registry key you normally then need to trigger an
event -

    HANDLE hBackLightEvent = CreateEvent(NULL, FALSE, TRUE, TEXT
("BacklightChangeEvent"));
    if (hBackLightEvent)
    {
        SetEvent(hBackLightEvent);
        CloseHandle(hBackLightEvent);
    }

cheers
Bruce

> Is there a documented way to set the backlight level while on external
> power?
[quoted text clipped - 20 lines]
> Mobile 6, but a documented way to do this would be preferred so I don't have
> to change it every time Microsoft decides to change their implementation.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.