I have a command button called CmdPlay.
What code do I type in so that it plays a certain MIDI file when I click on it? Please Help me
Thanks
Printable View
I have a command button called CmdPlay.
What code do I type in so that it plays a certain MIDI file when I click on it? Please Help me
Thanks
Use the mciSendString API.
Code:Private 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
Private Sub cmdStart_Click()
'Start playing
mciSendString "open C:\mptheme.mid type sequencer alias midi", 0, 0, 0&
mciSendString "play midi", 0, 0, 0&
End Sub
Private Sub cmdStop_Click()
'Stop Playing
mciSendString "close midi", 0, 0, 0&
End Sub
the other way is to use the Microsoft Multimedia control 6.0 what shipping with VB6.0