|
-
Jun 5th, 2001, 09:16 PM
#1
Thread Starter
New Member
System Volume
does anybody know how to change the main sound volume of the system...
i cant find the api call.
-
Jun 8th, 2001, 09:44 AM
#2
Lively Member
Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long
This example will set the volume of auxiliary audio device 0 to 50%.
Dim retval As Long
' Set the volume of both channels (if a second exists) to 50%
retval = auxSetVolume(0, &H80008000) ' both words are set
-
Jun 9th, 2001, 06:59 PM
#3
Hyperactive Member
I had a problem with this
I realized that it hold the value of a long to 64000.... and then it wraps around, but how come sometimes it centers it to the left speakers and other times to the right speaker?? This is if I just use a long variable in the function?? Any ideas?
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
-
Jun 12th, 2001, 04:47 AM
#4
Try This:
Code:
Dim lngSetVolTo As Long
Dim strTemp As String
lngSetVolTo = X / 100 * 65536
strTemp = Hex(lngSetVolTo + 65536)
If strTemp <> "20000" Then
strTemp = Right(strTemp, 4)
lngSetVolTo = CLng("&H" & strTemp & strTemp)
auxSetVolume Y, lngSetVolTo
Else
auxSetVolume Y, -1
End If
X is the percentage of volume, and Y is the device number.
-
Jun 1st, 2002, 11:02 PM
#5
Addicted Member
dreamlax i cant get your snippet to work
how does it work or can u make a zip pls
thanks trav
-
Jun 2nd, 2002, 10:56 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|