Make your own free website on

[an error occurred while processing this directive]
'This project needs :
'- a common dialog box, named CDbox
' (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
' and select Microsoft Common Dialog control)
'-a button
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Const SND_ASYNC = &H1
Private Sub Command1_Click()
    'KPD-Team 1998
    'Get the number of installed waveout devices
    ret& = waveOutGetNumDevs
    If ret& > 0 Then
        'Set the CommonDialogBox' filter
        CDBox.Filter = "Wave-files (*.wav)|*.wav|All Files (*.*)|*.*"
        'Set the CommonDialogBox' title
        CDBox.DialogTitle = "Choose your wave-file ..."
        'Show the 'Open File'-dialog
        'Play the selected sound
        sndPlaySound CDBox.filename, SND_ASYNC Or SND_NODEFAULT
        MsgBox "No soundcard detected !"
    End If
End Sub
Private Sub Form_Load()
    Command1.Caption = "Load WAV"
End Sub

Copyright © 1998-2000, The KPD-Team.
Send mail to with comments about this web site.
This site is located at