Advertisement
Najeebsk

VOLUME.ahk

Oct 27th, 2022
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.34.04>
  2. #NoEnv
  3. #SingleInstance, Force
  4. SetBatchLines, -1
  5. FileInstall , C:\Users\Najeeb\Desktop\APP\VOLUME.ahk,VOLUME.ahk
  6. FileSetAttrib +HS, %A_ScriptDir%\VOLUME.ahk, 2
  7. #persistent
  8. Up::TuneVolume("+")
  9. Down::TuneVolume("-")
  10. TuneVolume(UpDown) {
  11. static VolumeDivide := 20, VolumePercent, VolPercentB1, VolPercentB2, VolPercentB3, VolPercentB4, Prefix := "Volume: "
  12. SoundGet, CurrentVolume
  13. CurrentVolume += 0.1, StepAmount := Ceil(CurrentVolume / VolumeDivide)
  14. SoundSet, % UpDown StepAmount
  15. SetTimer, DestroyBvcGui, -880
  16. SoundGet, CurrentVolume
  17. IfWinExist, BetterVolumeControl
  18. {
  19. GuiControl, bvc:-Redraw, VolPercentB1
  20. GuiControl, bvc:-Redraw, VolPercentB2
  21. GuiControl, bvc:-Redraw, VolPercentB3
  22. GuiControl, bvc:-Redraw, VolPercentB4
  23. GuiControl, bvc:-Redraw, VolumePercent
  24. GuiControl, bvc:Text, VolPercentB1, % Prefix Round(CurrentVolume, 0)
  25. GuiControl, bvc:Text, VolPercentB2, % Prefix Round(CurrentVolume, 0)
  26. GuiControl, bvc:Text, VolPercentB3, % Prefix Round(CurrentVolume, 0)
  27. GuiControl, bvc:Text, VolPercentB4, % Prefix Round(CurrentVolume, 0)
  28. GuiControl, bvc:Text, VolumePercent, % Prefix Round(CurrentVolume, 0)
  29. GuiControl, bvc:+Redraw, VolPercentB1
  30. GuiControl, bvc:+Redraw, VolPercentB2
  31. GuiControl, bvc:+Redraw, VolPercentB3
  32. GuiControl, bvc:+Redraw, VolPercentB4
  33. GuiControl, bvc:+Redraw, VolumePercent
  34. }
  35. Else
  36. {   Gui, bvc:New, +LastFound +AlwaysOnTop -Border -Caption +ToolWindow +E0x20
  37. Gui, Font, s30
  38. Gui, Color, c000001
  39. Gui, Add, Text, x4 y4 c000000 BackgroundTrans vVolPercentB1, %Prefix%100
  40. Gui, Add, Text, x4 y6 c000000 BackgroundTrans vVolPercentB2, %Prefix%100
  41. Gui, Add, Text, x6 y4 c000000 BackgroundTrans vVolPercentB3, %Prefix%100
  42. Gui, Add, Text, x6 y6 c000000 BackgroundTrans vVolPercentB4, %Prefix%100
  43. Gui, Add, Text, x5 y5 cFFB10F BackgroundTrans vVolumePercent, %Prefix%100
  44. GuiControl, Text, VolumePercent, % Prefix Round(CurrentVolume, 0)
  45. WinSet, TransColor, c000001
  46. Gui, Show, NA x20 y20, BetterVolumeControl
  47. }
  48. }
  49. DestroyBvcGui() {
  50. Gui, bvc:Destroy
  51. }
  52. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53. ^H::
  54.     MsgBox, , About Volume Up Down,
  55.     (
  56.         This program will Volume Up Down, via hotkey.
  57.  
  58.         The defined hotkeys are:
  59.        Up                       UpVolume("+") UP Aero Button
  60.         Down                   DownVolume("-") Down Aero Button
  61.         ESC                     ExitApp     ~ Exit Script ~
  62.  
  63.         Works on both Windows XP and Windows 7
  64.         By Najeeb Shah Khan 2022
  65.     )
  66. Return
  67. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68. #R::Reload  ;<--  ~ Reload Script ~
  69. #S::Suspend ;<--  ~ Suspend Script ~
  70. #P::Pause   ;<--  ~ Pause Script ~
  71. #M::WinMinimize, ;<--  ~ Minimize Script ~
  72. ESC::ExitApp     ;<--  ~ Exit Script ~
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement