Home > Software engineering >  Vb6.0 by use acquisition system the main volume
Vb6.0 by use acquisition system the main volume

Time:09-20

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,

CodePudding user response:

Only found a GetDefaultAudioEndpoint

CodePudding user response:

refer to the second floor bakw response:
didn't see,,,
But waveOutGetVolume is to adjust the master level, but under the win10 haven't tried, there is nothing wrong with xp system,

Also "faulty" under XP system, you didn't notice it,

Need the meaning of the building Lord, is that "the left", and this code to get/set, is the second "waveform" channel,


In addition, the Integer & lt; ---> Operating through the string, whether further?
A bit operations directly, don't come out yet, the code is simple, is N times higher operation efficiency...

Windows 7, already can't find "all channel" respectively control the volume of the place, it seems to "process" to control,
Sample Win10 is that bird...


CodePudding user response:


My program is full exclusive, not in my program in tuning the amount they can't find places

CodePudding user response:

reference 5 floor bakw reply:

My program is full exclusive, not in my program in tuning the amount they can't find places


Rogue...

Exclusive full screen also is ok, you yourselves to minimize, or Kill your process line,

CodePudding user response:

Have a process to protect, and they were afraid to foreground program crashes unexpectedly,
And the pit of startup explorer accounted for by me ,
Is out of my program, rather than desktop
So kill a program is not to the desktop, but the desktop after normal program exit or is, software is set up after exit back to the desktop or shutdown,
And then the task manager can still come out

CodePudding user response:

But now a lot of programs are doing the touch screen software, used a computer hardware problem of too many,

CodePudding user response:

Try to use the API Monitor monitoring system volume control,
  • Related