Κυριακή 28 Φεβρουαρίου 2010

How to play sounds with Visual Basic 6



Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, _
    ByVal uFlags As Long) As Long
    
    Private Const sndAsync = &H1
Private Const sndLoop = &H8
Private Const sndNoStop = &H10



Private Sub cmdplay_Click()
sndPlaySound "c:\R66an_1.wav", sndAsync
End Sub

With this program you can play a wav file from your hard disk 
In this example it is c:\R66an_1.wav
It works in VB6!