Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;BitByteBit
- FileInstall('LightFX 64x.dll', 'LightFX 64x.dll');Extract AlienFX DLL.
- HotKeySet('^{F4}', '_Hotkey');Set Hotkeys.
- HotKeySet('^{F5}', '_Hotkey')
- Global $hGUI, $hCombo, $hBright
- Global $hLightFX, $iBrightness = 100
- $hLightFX = DllOpen(@ScriptDir & '\LightFX 64x.dll') ;Open AlienFX DLL.
- If $hLightFX = -1 Then Exit MsgBox(48, 'FATALITY!', 'Failed to find: "LightFX 64x.dll".')
- $aTmp = DllCall($hLightFX, 'uint', 'LFX_Initialize')
- If $aTmp[0] = 1 Then Exit MsgBox(0, 'FATALITY!', 'Please enable 3rd party access via the Command Center tray icon, then restart the program.')
- $hGUI = GUICreate("Keyboard Brightness", 150, 70) ;Create GUI.
- GUISetOnEvent(-3, '_Exit')
- $hCombo = GUICtrlCreateCombo("", 10, 32, 130)
- $hBright = GUICtrlCreateLabel("Brightness: 100%", 30, 10)
- GUICtrlSetColor(-1, 0xFFFFFF)
- GUICtrlSetData($hCombo, "Blue|Cyan|Green|Indigo|Orange|Pink|Red|Violet|White|Yellow|")
- GUISetBkColor(0x1F1F1F)
- GUISetState(@SW_SHOW)
- While 1
- Sleep(100)
- WEnd
- Func _Hotkey()
- If @HotKeyPressed = "^{F4}" Then
- $iBrightness += 10
- If $iBrightness > 100 Then $iBrightness = 100
- Else
- $iBrightness -= 10
- If $iBrightness < 0 Then $iBrightness = 0
- EndIf
- $iTmp = Hex(Round($iBrightness * 2.55), 2)
- GUICtrlSetData($hBright, 'Brightness: ' & $iBrightness & "%")
- $iColour = GUICtrlRead($hCombo)
- _RGBToString($iColour)
- $iColour = '0x' & $iTmp & $iColour
- DllCall($hLightFX, 'uint', 'LFX_Light', 'uint', 0x07FFFFFF, 'uint', $iColour)
- DllCall($hLightFX, 'uint', 'LFX_Update')
- EndFunc ;==>_Hotkey
- Func _Exit()
- DllCall($hLightFX, 'uint', 'LFX_Release')
- DllClose($hLightFX)
- Exit
- EndFunc ;==>_Exit
- Func _RGBToString(ByRef $sStr1)
- Switch $sStr1
- Case "Blue"
- $sStr1 = '0000FF'
- Case "Cyan"
- $sStr1 = '00FFFF'
- Case "Green"
- $sStr1 = '00FF00'
- Case "Indigo"
- $sStr1 = '3F48CC'
- Case "Orange"
- $sStr1 = 'FF8000'
- Case "Pink"
- $sStr1 = 'FF80FF'
- Case "Red"
- $sStr1 = 'FF0000'
- Case "Violet"
- $sStr1 = '8000FF'
- Case "White"
- $sStr1 = 'FFFFFF'
- Case "Yellow"
- $sStr1 = 'FFFF00'
- EndSwitch
- EndFunc ;==>_RGBToString
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement