Ever wanted to know if a PC has a sound card or not? This simple piece of code does exactly that!
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Private Sub cmdCanPlay_Click()
Dim i As Long
i = waveOutGetNumDevs()
If i > 0 Then
MsgBox "Your system can play
sound files.", _
vbInformation, "Sound Card
Test"
Else
MsgBox "Your system can not play
sound Files.", _
vbInformation, "Sound Card
Test"
End If
End Sub
Comments