Code for module
Code:
Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long
Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long
Code for a CommandButton
Code:
' Get the volume
retval = waveOutGetVolume(0, volume)
volume = volume And &HFFFF
DisplayVol = Hex(volume)
MsgBox (DisplayVol)
Code for another CommandButton
Code:
' Set the volume to 50%
retval = waveOutSetVolume(0, &H7FFF7FFF)