VERSION 5.00
Object = "{C1A8AF28-1257-101B-8FB0-0020AF039CA3}#1.1#0"; "MCI32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5100
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6240
   LinkTopic       =   "Form1"
   ScaleHeight     =   5100
   ScaleWidth      =   6240
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtTrackLength 
      Height          =   495
      Left            =   720
      TabIndex        =   3
      Text            =   "Text1"
      Top             =   4080
      Width           =   4215
   End
   Begin VB.TextBox txtCurrentTrack 
      Height          =   735
      Left            =   720
      TabIndex        =   2
      Text            =   "Text2"
      Top             =   2880
      Width           =   4215
   End
   Begin VB.TextBox txtTotalTracks 
      Height          =   735
      Left            =   720
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   1320
      Width           =   3975
   End
   Begin MCI.MMControl MMControl1 
      Height          =   495
      Left            =   840
      TabIndex        =   0
      Top             =   360
      Width           =   3615
      _ExtentX        =   6376
      _ExtentY        =   873
      _Version        =   393216
      DeviceType      =   ""
      FileName        =   ""
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "CDAudio"
    MMControl1.Command = "Open"
    txtTotalTracks.Text = Format$(MMControl1.Tracks, "00")
End Sub

Private Sub Form_Unload(Cancel As Integer)
    MMControl1.Command = "Stop"
    MMControl1.Command = "Close"
End Sub

Private Sub MMControl1_NextCompleted(Errorcode As Long)
    Call UpdateInformation
End Sub

Private Sub MMControl1_PrevCompleted(Errorcode As Long)
    Call UpdateInformation
End Sub

Private Sub MMControl1_StatusUpdate()
    Call UpdateInformation
End Sub

Private Sub UpdateInformation()
    Dim min1 As Integer, min2 As Integer
    Dim sec1 As Integer, sec2 As Integer
    
    txtCurrentTrack.Text = Format$(MMControl1.Track, "00")
    txtTrackLength.Text = _
        Format$(MMControl1.TrackLength And &HFF, "00") & ":" & _
        Format$((MMControl1.TrackLength And &HFF00) \ &H10000, "00")
End Sub
