Muting and controlling the volume

  • Thread starter Thread starter John Clark
  • Start date Start date
J

John Clark

Hello all,

I'm developing an application thats operation requires the volume NOT to be
muted - for notification purposes.

I've had a quick look round and don't seem to be having much luck - has
anyone done this before that can point me in the right direction?

Thanks,

JC
 
John Clark said:
Hello all,

I'm developing an application thats operation requires the volume NOT to
be muted - for notification purposes.

I've had a quick look round and don't seem to be having much luck - has
anyone done this before that can point me in the right direction?

Thanks,

JC

Actually, just muting all or unmuting all would be the biggest help - I'm
guessing this is some sort of API call with winmm?
 
Perhaps (VB6 code):

Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As
Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As
Integer, dwVolume As Long) As Integer

Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub

Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top