and you do not remember how you can regulate it ?
I get a solution !
TinyBrightnessControler
Left click on Tray Icon for show Controler and Right click for Tray Menu, that's all !
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Electric bulb1.ico #AutoIt3Wrapper_outfile=TinyBrightnessControler.exe #AutoIt3Wrapper_Res_Description=Adjust Screen Brightness #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2011 wakillon #AutoIt3Wrapper_Res_SaveSource=y ://////=__= ://////=__= #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ----------------------------------------------------------------------------------------------------------- AutoIt Version : 3.3.6.1 Author : wakillon Based on the noctis Post : <a href='http://autoit.de/index.php?page=Thread&postID=83474#post83474' class='bbc_url' title='External link' rel='nofollow external'>http://autoit.de/index.php?page=Thread&postID=83474#post83474</a> Title : TinyBrightnessControler Script Fonction : Adjust Screen Brightness. Left click on Tray Icon for show Controler and Right click for Tray Menu. #ce ----------------------------------------------------------------------------------------------------------- #include <WindowsConstants.au3> #include <GuiSlider.au3> Opt ( "TrayOnEventMode", 1 ) Opt ( "TrayMenuMode", 1 ) OnAutoItExitRegister ( "_Exit" ) Global Const $TRAY_UNCHECKED = 4 Global Const $TRAY_EVENT_PRIMARYDOWN = -7 Global $_Rgb, $_DefaultItem, $_GetPosOld, $_AboutItem, $_TitleItem, $_UpdateItem, $_SaveItem Global $_Gui, $_Slider, $_Label1, $_Label2, $_Dll Global $_Version = _GetScriptVersion ( ) _TrayMenu ( ) $_Rgb = RegRead ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma" ) If $_Rgb = '' Then $_Rgb =128 $_GetPosOld=$_Rgb _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) While 1 Sleep ( 10 ) WEnd Func _DisplaySlider ( ) Local $_MousePos = MouseGetPos ( ) Local $_GuiWight= 50, $_GuiHeight=230 Local $_Gui = GUICreate ( "", $_GuiWight, $_GuiHeight, $_MousePos[0]-$_GuiWight/2, @DesktopHeight - $_GuiHeight - _GetTaskbarHeight ( ) -2, _ BitOR ( $WS_POPUP, $WS_BORDER ), $WS_EX_TOPMOST, WinGetHandle ( AutoItWinGetTitle ( ) ) ) $_Label1 = GUICtrlCreateLabel ( "Min", 15, 10 ) $_Slider = GUICtrlCreateSlider ( 15, 30, 20, 180, BitOR ( $TBS_VERT, $TBS_TOOLTIPS, $TBS_AUTOTICKS ) ) GUICtrlSetLimit ( -1, 256, 0 ) $_Label2 = GUICtrlCreateLabel ( "Max", 15, 210 ) GUISetState ( ) _GUICtrlSlider_SetPos ( $_Slider, $_GetPosOld ) $_TimerInit = TimerInit ( ) While 1 $_GetPos = _GUICtrlSlider_GetPos ( $_Slider ) If $_GetPos <> $_GetPosOld Then $_Rgb = $_GetPos _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) $_GetPosOld = $_GetPos $_TimerInit = TimerInit ( ) EndIf If _IsMouseOverCtrls ( $_Gui ) Then $_TimerInit = TimerInit ( ) $_TimerDiff = Round ( TimerDiff ( $_TimerInit )/ 1000 ) If $_TimerDiff > 2 Then ExitLoop WEnd GUIDelete ( ) EndFunc ;==> _DisplaySlider ( ) Func _IsMouseOverCtrls ( $_GuiHwnd, $_Active=0 ) $_CursorInfo = GUIGetCursorInfo ( $_GuiHwnd ) If Not @error Then Switch $_CursorInfo[4] Case $_Slider, $_Label1, $_Label2 Return 1 EndSwitch EndIf EndFunc ;==> _IsMouseOverCtrls ( ) Func _Normal ( ) TrayItemSetState ( $_DefaultItem, $TRAY_UNCHECKED ) $_Rgb = 128 $_GetPosOld = 128 _SetGamma ( $_Rgb, $_Rgb, $_Rgb ) EndFunc ;==> _Normal ( ) Func _Exit ( ) DllClose ( $_Dll ) Exit EndFunc ;==> _Exit ( ) Func _SetGamma ( $vRed=128, $vGreen=128, $vBlue=128 ) Local $n_ramp, $rVar, $gVar, $bVar, $Ret, $i, $dc If $vRed < 0 Or $vRed > 386 Then Return -1 If $vGreen < 0 Or $vGreen > 386 Then Return -1 If $vBlue < 0 Or $vBlue > 386 Then Return -1 $dc = DLLCall ( "user32.dll", "int", "GetDC","hwnd", 0 ) $n_ramp = DllStructCreate ( "short[" & ( 256*3 ) & "]" ) For $i = 0 to 256 $rVar = $i * ( $vRed + 128 ) If $rVar > 65535 Then $rVar = 65535 $gVar = $i * ( $vGreen + 128 ) If $gVar > 65535 Then $gVar = 65535 $bVar = $i * ( $vBlue + 128 ) If $bVar > 65535 Then $bVar = 65535 DllStructSetData ( $n_ramp, 1, Int ( $rVar ), $i ) ; red DllStructSetData ( $n_ramp, 1, Int ( $gVar ), $i+256 ) ; green DllStructSetData ( $n_ramp, 1, Int ( $bVar ), $i+512 ) ; blue Next $ret = DLLCall ( "gdi32.dll", "int", "SetDeviceGammaRamp", "int", $dc[0], "ptr", DllStructGetPtr ( $n_Ramp ) ) $dc = 0 $n_Ramp = 0 EndFunc ;==> _SetGamma ( ) Func _TrayMenu ( ) $_TempDir = @TempDir & 'TBCskin' If Not FileExists ( $_TempDir ) Then DirCreate ( $_TempDir ) If Not FileExists ( $_TempDir & 'Electric bulb1.ico' ) Then _ InetGet ( 'http://tinyurl.com/d3srkot', $_TempDir & 'Electric bulb1.ico', 9, 0 ) TraySetToolTip ( $_Version & @CRLF & @CRLF & '* Left click for show Controler' & @CRLF & '* Right click for Tray Menu' & @CRLF ) TraySetIcon ( $_TempDir & 'Electric bulb1.ico' ) TraySetClick ( 16 ) TraySetOnEvent ( $TRAY_EVENT_PRIMARYDOWN, '_DisplaySlider' ) $_TitleItem = TrayCreateItem ( $_Version ) TrayItemSetOnEvent ( -1, '_UnCheck' ) TrayCreateItem ( '' ) $_DefaultItem = TrayCreateItem ( 'Set Brightness To Normal' ) TrayItemSetOnEvent ( -1, '_Normal' ) TrayCreateItem ( '' ) $_UpdateItem = TrayCreateItem ( "See For Update" ) TrayItemSetOnEvent ( -1, '_SeeForUpdate' ) TrayCreateItem ( "" ) $_AboutItem = TrayCreateItem ( "About" ) TrayItemSetOnEvent ( -1, '_About' ) TrayCreateItem ( "" ) $_SaveItem = TrayCreateItem ( "Save Settings" ) TrayItemSetOnEvent ( -1, '_Save' ) TrayCreateItem ( "" ) $_ExitItem = TrayCreateItem ( 'Exit' ) TrayItemSetOnEvent ( -1, '_Exit' ) TraySetState ( 4 ) EndFunc ;==> _TrayMenu ( ) Func _Save ( ) TrayItemSetState ( $_SaveItem , $TRAY_UNCHECKED ) RegWrite ( "HKEY_LOCAL_MACHINESoftwareTBC", "Gamma", "REG_SZ", $_Rgb ) Msgbox ( 262144+4160, "Saved", "Gamma Settings have been saved", 3 ) EndFunc Func _SeeForUpdate ( ) TrayItemSetState ( $_UpdateItem , $TRAY_UNCHECKED ) ShellExecute ( 'http://www.autoitscript.com/forum/topic/127668-tinybrightnesscontroler/' ) EndFunc ;==> _SeeForUpdate ( ) Func _UnCheck ( ) TrayItemSetState ( $_TitleItem , $TRAY_UNCHECKED ) EndFunc ;==> _UnCheck ( ) Func _GetScriptVersion ( ) If Not @Compiled Then Return StringTrimRight ( @ScriptName, 4 ) & ' © wakillon 2010 - 2011' Else Return StringTrimRight ( @ScriptName, 4 ) & ' v' & FileGetVersion ( @ScriptFullPath ) & ' © wakillon 2010 - 2011' EndIf EndFunc ;==> _GetScriptVersion ( ) Func _About ( ) TrayItemSetState ( $_AboutItem , $TRAY_UNCHECKED ) Msgbox ( 262144+4160, "About : ", $_Version & @CRLF & @CRLF & "April 2011" & @CRLF & @CRLF & "Based on the noctis's Gamma Topic on AutoIt.de" & @CRLF & @CRLF & "wakillon." & @CRLF & " " ) EndFunc ;==> _About ( ) Func _GetTaskbarHeight ( ) $_OptOld = Opt ( "WinTitleMatchMode", 4 ) $_WinPos = WinGetPos ( "classname=Shell_TrayWnd" ) If @error Then Return -1 Opt ( "WinTitleMatchMode", $_OptOld ) Return $_WinPos[3] EndFunc ;==> _GetTaskbarHeight ( )
Scripts and executables with full embeded files are available on GoogleCode, see link in my sig.
Comments are welcome !
All this time spent in front of the screen, remember to protect your eyes !
Edited by wakillon, 08 October 2012 - 04:42 PM.









