'Author: gordon F. Macleod' How to Play A CD Audio Disc Via API
'Declare the folload & lib "mmsystem" (byval lpstr ", byval lpstrreturnstr asse any, byval Wreturn%, byval hcallback%)
'Add the code below to appropriate routines
Sub cmdplay_click () DIM LRET AS Long Dim NcurrentTrack AS INTEGER
'Open the device lret = mcIndstring ("Open CDAUDIO ALIAS CD WAIT", 0 &, 0, 0)
'Set the time format to tracks (default is milliseconds) Lret = mcIndstring ("SET CD Time Format TMSF", 0 &, 0, 0)
'Ten to Play from the beginning Lret = McIndstring ("Play CD", 0 &, 0, 0)
'Or to play from a specific TRACK, SAY TRACK 4 NCURRENTTRACK = 4 LRET = McIndstring ("Play CD from" & Str (NcurrentTrack), 0 &, 0, 0)
End Sub
'Remember to Close the Device When ending playback
SUB CMDSTOP_CLICK () DIM LRET AS Long
'Stop the Playback Lret = MCISENDSTRING ("Stop CD Wait", 0 &, 0, 0)
Doevents' Let Windows Process The Event
'Close the Device Lret = McISendstring ("Close CD", 0 &, 0, 0)
End Sub