Eu tenho usado o script da ferrix há algum tempo, mas eu o modifiquei para definir todos os controles deslizantes de volume do aplicativo para que correspondam ao volume principal atual, em vez de defini-los todos para 50%.
Eu também o alterei para que ele funcione em controles deslizantes com volumes definidos abaixo de 3%.
Volume_Normalize_Alt.au3:
#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>
Func SlideTo($Win, $Ctrl, $Pct)
If Not IsInt($Pct) Or $Pct < 0 Or $Pct > 100 Then
SetError(1)
Return False
EndIf
$CtrlHandle = ControlGetHandle($Win, '', $Ctrl)
If Not $CtrlHandle Then
SetError(2)
Return False
EndIf
Local $SetValue, $SendValue
If $Pct <= 51 Then
$SetValue = $Pct + 1
$SendValue = '{UP}'
Else
$SetValue = $Pct - 1
$SendValue = '{DOWN}'
EndIf
_GUICtrlSlider_SetPos($CtrlHandle, $SetValue)
Local $PrevOpt = Opt('SendKeyDelay', 1)
ControlSend($Win, '', $Ctrl, $SendValue)
Opt('SendKeyDelay', $PrevOpt)
Return True
EndFunc ;==>SlideTo
Func EachSliderTo($Win, $Pct)
WinWait($Win, "")
If Not WinActive($Win, "") Then WinActivate($Win, "")
Local $i = 1
If Not WinActive($Win, "") Then WinActivate($Win, "")
While True
$Ctrl = "[CLASS:msctls_trackbar32; INSTANCE:" & $i & "]"
If Not SlideTo($Win, $Ctrl, $Pct) Then
ExitLoop
EndIf
$i = $i + 1
WEnd
Return True
EndFunc ;==>EachSliderTo
$Win = "Volume Mixer"
$Prog = "SndVol.exe"
If Not WinActive($Win, "") Then
If Not WinActivate($Win, "") Then
ShellExecute($Prog)
If Not WinActive($Win, "") Then WinActivate($Win, "")
EndIf
EndIf
WinWait($Win)
;Master volume has the highest instance number so find slider with highest instance then return its handle.
Local $i = 1
While True
Local $h = ControlGetHandle($Win, '', "[CLASS:msctls_trackbar32; INSTANCE:" & $i & "]")
If @error > 0 Then
ExitLoop
EndIf
$i = $i + 1
Local $Handle = $h ;store last sucessful handle to be returned
WEnd
Local $CurrMasterVol = _GUICtrlSlider_GetPos($Handle)
;100 is 0% and 0 is 100%
;EachSliderTo("Volume Mixer", 100) ;What is the point of doing this first?
EachSliderTo("Volume Mixer", $CurrMasterVol)
WinClose("Volume Mixer")
O crédito vai para a ferrix por escrever o roteiro original.