locked
Unable to set Backlight Timeout value RRS feed

  • Question

  •  

    Hi,

     

    I am developing a Windowsmobile 5.0 application for Symbol MC70 device in C# VS2005.

    I want to change the Backlight Timeout property programmatically. I couldn't find any method to do this in the symbol SDK. So I did in the following way:

     

    Code Block

    RegistryKey regBacklight = Registry.CurrentUser.OpenSubKey(@"\ControlPanel\backlight", true);

    regBacklight.SetValue("BatteryTimeout", 120, RegistryValueKind.DWord);

    regBacklight.SetValue("ACTimeout", 120, RegistryValueKind.DWord);

    regBacklight.Close();

     

     

    When I refer the Registry, the values are updated successfully. But in actual, the OS is assuming the values which I have set through Settings->system->Backlight and not the programmed values.

     

    Is there anything else that I am missing?

     

    Thursday, November 22, 2007 12:51 PM

Answers

  • Hi Selva kumar,

    Base on my understanding, you want to change Backlight Timeout value programmatically. If I have misunderstood you, please let me know, thanks.

     

    Your code is right.  The BatteryTimeout and ACTimeout  stores in the registry, so I am afraid, you have to change the registry value to change backlight timeout. and throuht Settings--system--backlight steps do the same that change registry value.

     

    So only this way meet your request.

     

    Best regards,

    Guang-Ming Bian - MSFT

    Monday, November 26, 2007 7:38 AM
  • Hi Guang-Ming Bian,

     

    Thanks for your effort. My Team Lead helped me in sorting out this issue.

     

    According to my understanding from this MSDN link, the OS will read the timeout values when the device boots and thereafter it will reload the timeout values, only if you set it through Settings--system--backlight. If you just edit the registry value the OS will not reload it automatically.

     

    So, to reload the timeout values we have to create a named auto-reset event called "PowerManager/ReloadActivityTimeouts" and call SetEvent() on its handle. But for the Symbol device, this name is "BackLightChangeEvent" which can be found in the RegistryPath HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Backlight\ReloadEventName.

     

    To know how to create an AutoResetEvent refer this link

     

     

    Monday, November 26, 2007 8:38 AM

All replies

  • Hi Selva kumar,

    Base on my understanding, you want to change Backlight Timeout value programmatically. If I have misunderstood you, please let me know, thanks.

     

    Your code is right.  The BatteryTimeout and ACTimeout  stores in the registry, so I am afraid, you have to change the registry value to change backlight timeout. and throuht Settings--system--backlight steps do the same that change registry value.

     

    So only this way meet your request.

     

    Best regards,

    Guang-Ming Bian - MSFT

    Monday, November 26, 2007 7:38 AM
  • Hi Guang-Ming Bian,

     

    Thanks for your effort. My Team Lead helped me in sorting out this issue.

     

    According to my understanding from this MSDN link, the OS will read the timeout values when the device boots and thereafter it will reload the timeout values, only if you set it through Settings--system--backlight. If you just edit the registry value the OS will not reload it automatically.

     

    So, to reload the timeout values we have to create a named auto-reset event called "PowerManager/ReloadActivityTimeouts" and call SetEvent() on its handle. But for the Symbol device, this name is "BackLightChangeEvent" which can be found in the RegistryPath HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Backlight\ReloadEventName.

     

    To know how to create an AutoResetEvent refer this link

     

     

    Monday, November 26, 2007 8:38 AM