$scHwnd = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
$hDC = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $scHwnd[0])
$PriBright = DllStructCreate("ulong[256];ulong[256];ulong[256]")
$resGetBright = DllCall("Gdi32.dll", "int", "GetDeviceGammaRamp", "hwnd", $hDC[0], "ptr", DllStructGetPtr($PriBright))
$NewBright = DllStructCreate("ulong[256];ulong[256];ulong[256]")
For $a = 1 to 256
For $d = 1 to 3
DllStructSetData($NewBright, $d, DllStructGetData($PriBright, 1, $a) / 2, $a)
Next
Next
$res = DllCall("Gdi32.dll", "int", "SetDeviceGammaRamp", "hwnd", $hDC[0], "ptr", DllStructGetPtr($NewBright))
$PriBright = 0
$NewBright = 0
If $res[0] then msgBox(64, '', 'Done')
新亮度是根据当前亮度的一半值来的,所以不要调太大,也不要调太小,会造成花屏。虽然测试重启就恢复正常。
[ 本帖最后由 pusofalse 于 2009-2-2 05:59 编辑 ] |