'Code '**************************************************************** ' Name: CD Audio.BAS ' Description:libaray of functions for CDAudio (requires MCI ' -control). mailto:"rickr@execpc.com" ' By: Found on the World Wide Web ' ' Inputs:None ' Returns:None ' Assumes:Rename to a .BAS to use! ' Side Effects:None ' 'Code provided by Planet Source Code(tm) 'as is', without ' warranties as to performance, fitness, merchantability, ' and any other warranty (whether expressed or implied). '**************************************************************** Attribute VB_Name = "CD_Serial_Number" Option Explicit Private Declare Function GetPrivateProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" _ (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" _ (ByVal AppName As String, ByVal KeyName As String, ByVal keydefault As String, ByVal Filename As String) As Long Global CDMin As Integer Global CDSec As Integer Global TMin As Integer Global TSec As Integer Global RMin As Integer Global RSec As Integer Global TimeTrack As String Global TimeElapsed As String Global TimeRemaining As String Global Artist1 As String Global Title1 As String Global Artist2 As String Global Title2 As String Sub CDAudioProperties() Dim T As Double On Error Resume Next T = Shell("rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3", 5) End Sub Function GetRawRemainingTime(MMCOntrol1 As Object) As String Dim Z As String, Min As String, Sec As String, _ Temp As String Z = GetRunningTime(MMCOntrol1) Z = GetTrackTime(MMCOntrol1) Min = LTrim$(Str$(CDMin - TMin)) Sec = LTrim$(Str$(CDSec - TSec)) RMin = Val(Min) RSec = Val(Sec) If RSec < 0 Then RSec = 60 + Val(Sec) RMin = RMin - 1 End If Min = LTrim$(Str$(RMin)) Temp = Trim$(Str$(RSec)) If Len(Temp) = 1 Then Sec = "0" + Temp Else Sec = Temp End If GetRawRemainingTime = Min + Sec End Function Function GetRemainingTime(MMCOntrol1 As Object) As String Dim Z As String, Min As String, Sec As String, _ Temp As String Z = GetRunningTime(MMCOntrol1) Z = GetTrackTime(MMCOntrol1) Min = LTrim$(Str$(CDMin - TMin)) Sec = LTrim$(Str$(CDSec - TSec)) RMin = Val(Min) RSec = Val(Sec) If RSec < 0 Then RSec = 60 + Val(Sec) RMin = RMin - 1 End If Min = LTrim$(Str$(RMin)) Temp = Trim$(Str$(RSec)) If Len(Temp) = 1 Then Sec = "0" + Temp Else Sec = Temp End If GetRemainingTime = Min + ":" + Sec End Function Sub GetTime(MMCOntrol1 As Object) Dim Z$ Z$ = GetRemainingTime(MMCOntrol1) End Sub Function GetTrackTime(MMCOntrol1 As Object) As String Dim Length&, Entry2$, Min$, Sec$, D$, Entry$ MMCOntrol1.TimeFormat = 2 Length& = MMCOntrol1.TrackLength Min$ = Str$(Length& And &HFF) Sec$ = LTrim$(Str$((Length&