Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SoundGetSetQuery.au3"
- Global $bState=False,$aIcon[4]=["low.ico","med.ico","max.ico","mute.ico"]
- $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume")
- If $iVolume<=33 Then TraySetIcon($aIcon[0])
- If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1])
- If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2])
- HotKeySet("{PGUP}","up")
- HotKeySet("{PGDN}","down")
- HotKeySet("{INS}","mute")
- Func up()
- If $bState==False Then
- $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume")
- Send("{VOLUME_UP}")
- If $iVolume<=33 Then TraySetIcon($aIcon[0])
- If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1])
- If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2])
- EndIf
- EndFunc
- Func down()
- If $bState==False Then
- $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume")
- Send("{VOLUME_DOWN}")
- If $iVolume>=1 And $iVolume<=33 Then TraySetIcon($aIcon[0])
- If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1])
- If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2])
- If $iVolume==0 Then TraySetIcon($aIcon[3])
- EndIf
- EndFunc
- Func mute()
- If $bState==True Then
- $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume")
- Send("{VOLUME_MUTE}")
- If $iVolume>=1 And $iVolume<=33 Then TraySetIcon($aIcon[0])
- If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1])
- If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2])
- If $iVolume==0 Then TraySetIcon($aIcon[3])
- $bState=False
- Else
- Send("{VOLUME_MUTE}")
- TraySetIcon($aIcon[3])
- $bState=True
- EndIf
- EndFunc
- While True
- Sleep(10)
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement