Dim ret As Integer
'Öppna midi filen "c:\windows\media\canyon.mid".
ret = lngReturnResult = mciSendString( _
"open c:\windows\media\canyon.mid type sequencer alias background", _
0, 0, 0)
'Spela midi filen.
ret = mciSendString("play background", 0, 0, 0)
'Stäng/Stoppa midi filen.
ret = mciSendString("close all", 0, 0, 0)
'Pausa filen.
ret = mciSendString("pause background", 0, 0, 0)
'Fortsätta spela efter pause.
ret = mciSendString("resume background", 0, 0, 0)