How can i change the volume or get the volume, or mute it ect.
Printable View
How can i change the volume or get the volume, or mute it ect.
Try this.
Code:Private Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long
Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long
Function GetVolume(id As Long) As Variant
Retval = waveOutGetVolume(1, volume)
volume = volume And &HFFFF
volume = Hex(volume)
GetVolume = volume
End Function
Function SetVolume(id As Long, vol As Long) As Variant
Retval = waveOutSetVolume(id, vol)
End Function
Private Sub Command1_Click()
'Set the volume to max
SetVolume 1, &HFFFF
End Sub