Click to See Complete Forum and Search --> : midi


phil m
March 14th, 2001, 04:28 AM
I found this answer posted here. Code below. It played once but never wants to again. What could have caused that?

Many thanks

Phil


Option Explicit
Private Sub Command2_Click() ' Open's the MIDI

mciSendString "open C:\WINDOWS\OPTIONS\CABS\CONTENT\WBROS\MED\MIDI\looneyto.mid type sequencer alias background", 0, 0, 0
' Play's the MIDI
mciSendString "play background", 0, 0, 0

End Sub
Private Sub cmdStop_Click() ' Closes the MIDI
mciSendString "close background", 0, 0, 0
End Sub


In a module
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long