Article ID: 112766
Article Last Modified on 10/29/2003
1:09:43
57:45
Sub Form_Load ()
' Initialize the CD:
mmcontrol1.TimeFormat = 10
mmcontrol1.DeviceType = "CDAudio"
mmcontrol1.Command = "Open"
' Dimension variables:
Dim Length As Variant
Dim CDSeconds As Integer, CDMinutes As Integer
' Calculate minutes and seconds:
CDSeconds = CDSeconds + (mmcontrol1.Length And &HFF00&) / &H100
CDMinutes = CDMinutes + (mmcontrol1.Length And &HFF)
' Sum minutes and seconds:
Length = DateAdd("s", CDSeconds, Length) ' Add Seconds
Length = DateAdd("n", CDMinutes, Length) ' Add Minutes
' Determine if total running time is less than one hour:
If (Left$(Length, 2)) = "12" Then ' Less than 1 hour
Text1.Text = Mid(Length, 4, (Len(Length) - 4))
Else ' Greater than 1 hour:
Text1.Text = Left(Length, (Len(Length) - 3))
End If
End Sub
Additional query words: 3.00
Keywords: KB112766