user366387
user366387

Reputation: 21

set backlight time

Is there any way to change backlight turn off TIME using programming(Preferred c# or vb.net other c++ can be used too)? I guess, may be it is changed using registry info or API.

Manually, it is done by:

Setting > Backlight (Battery Power and External Power)

Thank you

Upvotes: 1

Views: 2139

Answers (2)

JustAnotherCoder
JustAnotherCoder

Reputation: 621

::SystemParametersInfo does it. Specify uiAction parameter to SPI_SETBATTERYIDLETIMEOUT to adjust "battery timeout" and/or SPI_SETEXTERNALIDLETIMEOUT for "AC timeout".

See detailed information on msdn.

Upvotes: 0

ctacke
ctacke

Reputation: 67178

Adjust the following registry keys (which is what the CPL does):

[HKEY_CURRENT_USER\ControlPanel\Backlight]`
    "UseBattery"=dword        ;if '1' turn off the backligh after "BatteryTimeout" seconds
    "UseExt"=dword:           ;if '1' turn off the backligh after "ACTimeout" seconds
    "BatteryTimeout"=dword:X  ;backlight timeout in seconds 
    "ACTimeout"=dword:Y       ;backlight timeout in seconds

Then broadcast a WM_SETTINGCHANGE message.

Upvotes: 1

Related Questions