Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

playing midi files 1

Status
Not open for further replies.

ChrisProg

Programmer
Apr 4, 2001
41
0
0
GB
can someone plese tell me how i can make a midi file play from clicking a command button
if you can tell me i will be happy as this is the 3rd time i have asked this question.
 
Place this code in a module

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



open the midi file

i = mciSendString("open c:\music.mid type sequencer alias mid1", 0&, 0, 0)

play the midi file

i = mciSendString("play mid1", 0&, 0, 0)

If you want more explanations...Here's a link that may help you to play midi file with VB

 
thank you
i am a beginner at vb and only 12 years old
(chrisprog is my dad)
 
i have made a note of youre site and will tell others about it

tankyou evry very much
 
Nice ;-)

Have a star...

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top