Want to use vb to obtain system the master level, not to obtain waveform volume... So can't use waveOutGetVolume Ask the great spirit show Vb6.0 by use of win10,
CodePudding user response:
Mainly the two apis, a read the volume, a written volume, Detailed you can check online, code test, may be some small problems, but use to determine the no problem, WaveOutGetVolume WaveOutSetVolume
Private Declare Function waveOutGetVolume Lib "winmm. DLL" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long Private Declare Function waveOutSetVolume Lib "winmm. DLL" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long 'the volume range of 0 ~ 100 The Public Function GetVolume () As an Integer As Long Dim V WaveOutGetVolume 0, V V=CLng (" & amp; H "& amp; Right (Hex (V), 4)) GetVolume=CInt (100 * V/2 ^ 16) End the Function
Public Sub SetVolume (ByVal Volume As an Integer) Dim Str As String Str=Right (" 0000 "& amp; Hex (Volume/100 * 2 ^ 16), 4) WaveOutSetVolume 0, CLng (" & amp; H "& amp; Str & amp; Str) End Sub
CodePudding user response:
didn't see,,, But waveOutGetVolume is to adjust the master level, but win10 haven't tried, there is nothing wrong with xp system,