背光超时时间设置问题???请教各位
各位:
在控制面板->显示中设置的是背光的超时时间
相应注册表项为:
[HKEY_CURRENT_USER\ControlPanel\Backlight]
"BatteryTimeout"=dword: 3c
"ACTimeout"=dword:78
"UseBattery"=dword:1
"UseExt"=dword:1
"Brightness"=dword:0f
"UserC"=dword:1
"AdvancedCPL"="AdvBacklight"
在控制面板->电源中设置的是系统超时时间
相应注册表项为:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts]
"ACUserIdle"=dword:3c; in seconds
"ACSystemIdle"=dword:12c ; in seconds
"ACSuspend"=dword:0 ; in seconds
"BattUserIdle"=dword:3c; in seconds
"BattSystemIdle"=dword:b4; in seconds
"BattSuspend"=dword:12c; in seconds
最后我发现,无论我在控制面板->显示中设置多长时间,最终PM->PDD中读取的都是ACUserIdle
代码如下:
dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szPath, 0, 0, &hk);
if(dwStatus == ERROR_SUCCESS)
{
// read system power state timeouts
gdwACTimeoutToUserIdle = RegReadStateTimeout(hk, _T("ACUserIdle"), DEF_TIMEOUTTOUSERIDLE);
gdwACTimeoutToSystemIdle = RegReadStateTimeout(hk, _T("ACSystemIdle"), DEF_TIMEOUTTOSYSTEMIDLE);
gdwACTimeoutToSuspend = RegReadStateTimeout(hk, _T("ACSuspend"), DEF_TIMEOUTTOSUSPEND);
gdwBattTimeoutToUserIdle = RegReadStateTimeout(hk, _T("BattUserIdle"), DEF_TIMEOUTTOUSERIDLE);
gdwBattTimeoutToSystemIdle = RegReadStateTimeout(hk, _T("BattSystemIdle"), DEF_TIMEOUTTOSYSTEMIDLE);
gdwBattTimeoutToSuspend = RegReadStateTimeout(hk, _T("BattSuspend"), DEF_TIMEOUTTOSUSPEND);
// release resources
RegCloseKey(hk);
}
请问:如果我想通过设置控制面板->显示的超时时间将背光关掉,请问我是否需要修改PM相关代码
各位大侠是怎么实现的??
[解决办法]