#include <SoundQuery.au3>
Global $VistaVol, $PluginVol
Global $VistaVolDll = @ScriptDir & '\Vista_Vol.dll'
Global $vol, $mute
_OSCheck()
If $VistaVol Then
$PluginVol = PluginOpen($VistaVolDll)
EndIf
#AutoIt3Wrapper_Plugin_Funcs = _GetMasterVolumeScalar_Vista, _SetMasterVolumeScalar_Vista, _IsMute_Vista, _SetMute_Vista
If $VistaVol then
$vol = Round(_GetMasterVolumeScalar_Vista())
$mute = _IsMute_Vista()
Else
$vol = Round(_SoundGetMasterVolume())
$mute = _SoundGetMasterMute()
EndIf
MsgBox(0, "", "Уровень звука: " & $vol & @CRLF & "Звук включён (0-да, 1-нет): " & $mute)
Func _OSCheck()
If @OSType = 'WIN32_NT' Then
Switch @OSVersion
Case 'WIN_2000', 'WIN_XP', 'WIN_2003'
$VistaVol = 0
Return
Case 'WIN_VISTA', 'WIN_2008', 'WIN_7'
$VistaVol = 1
Return
EndSwitch
EndIf
EndFunc