Example
In this section, we will develop a very simple audio
CD player. The source code needed for this example
is stored in the "Source Code\Chapter20\CD Player"
directory.
Private Sub Form_Load()
MMControl1.DeviceType = "CDAudio"
MMControl1.Command = "Open"
End Sub
Private Sub Form_Unload(Cancel As Integer)
MMControl1.Command = "Close"
End Sub
Private Sub MMControl1_StatusUpdate()
lblTrack.Caption = MMControl1.Track
End Sub
The application opens the CD playing multimedia
control when the form first loads. In the form unload
event, the code removes the CD player from memory.
In the StatusUpdate sub procedure, the code updates
the track number every time the CD's status changes.
|