|
-
Aug 21st, 2000, 08:00 PM
#1
Thread Starter
Lively Member
How can you get the speakers volume and get a notice when the volume changes. Thanks
-
Aug 21st, 2000, 08:45 PM
#2
Frenzied Member
I don't think you can get the Speaker volume, but you can get the system volume.
-
Aug 22nd, 2000, 09:04 AM
#3
Thread Starter
Lively Member
Well how would you find out the System Volume, I am guessing that there is some API to do it.
-
Aug 22nd, 2000, 10:53 AM
#4
Put the following in a Form with a Timer.
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
Dim OldVolume
Function GetVolume() As Variant
' Get the volume
Retval = waveOutGetVolume(1, volume)
volume = volume And &HFFFF
volume = Hex(volume)
GetVolume = volume
End Function
Private Sub Form_Load()
'Get the stsrting volume
OldVolume = GetVolume()
End Sub
Private Sub Timer1_Timer()
'Check if Volume has changed
If GetVolume <> OldVolume Then
MsgBox ("Volume has changed")
'Set the current volume as the "OldVolume"
OldVolume = GetVolume
End If
End Sub
-
Aug 22nd, 2000, 11:35 AM
#5
Thread Starter
Lively Member
I tried that code Megatron, but it didn't work for me, is that code suppose to trigger that msgbox if you change the
Total Volume or Wave Volume. The program kept thinking my volume was 0 for some reason.
-
Aug 22nd, 2000, 11:48 AM
#6
Change "1" to the your DeviceID in this line
Retval = waveOutGetVolume(1, volume)
-
Aug 22nd, 2000, 01:28 PM
#7
Fanatic Member
The volume control physically on the speakers cannot be accessed since it is local (eg it doesn't intercact with the computer)
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
|