Home » Questions » Computers [ Ask a new question ]

How to reset per application volume setting in Windows 7 and Vista

How to reset per application volume setting in Windows 7 and Vista

I've altered per application volume settings for my applications. I want to reset every individual volume setting so that all apps use the global volume settings. How should I do that?

Asked by: Guest | Views: 356
Total answers/comments: 2
Guest [Entry]

"I have to do this all-max -> reset all the time. I finally searched the net to see if there was some secret hot key or combo I was missing. Apparently not. :/

So I made an autoit script to do this more quickly than humanly possible :) I compiled it via tools->build and that way I can run the exe by searching in the start menu.

It causes all sliders to unmute and go to 50%.

Volume_Normalize.au3:

#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>

Func SlideTo($Win, $Ctrl, $Pct)

If Not IsInt($Pct) Or $Pct < 3 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

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

$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)
EachSliderTo(""Volume Mixer"",100);
EachSliderTo(""Volume Mixer"", 50);

Thanks to this autoit thread for info on moving slider controls."
Guest [Entry]

"I have been using ferrix's script for some time but I modified it to set all application volume sliders to to match the current master volume rather than setting them all to 50%.
I also altered it so that it works on sliders with volumes set less than 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"")

Credit goes to ferrix for writing the original script."