📄 各曲目播放时间的测定.frm
字号:
VERSION 5.00
Begin VB.Form Form2
Caption = "Form2"
ClientHeight = 1245
ClientLeft = 60
ClientTop = 345
ClientWidth = 5475
LinkTopic = "Form2"
ScaleHeight = 1245
ScaleWidth = 5475
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "退 出"
Height = 285
Left = 3720
TabIndex = 5
Top = 720
Width = 1365
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 270
Left = 3480
TabIndex = 4
Text = "Text1"
Top = 210
Width = 1635
End
Begin VB.TextBox Text2
Alignment = 1 'Right Justify
Height = 270
Left = 2100
TabIndex = 2
Text = "Text2"
Top = 720
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1050
TabIndex = 1
Top = 180
Width = 1065
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "总播放时间:"
Height = 180
Left = 2340
TabIndex = 6
Top = 240
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "当前音轨总播放时间:"
Height = 180
Left = 180
TabIndex = 3
Top = 780
Width = 1800
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "音轨选择:"
Height = 180
Left = 150
TabIndex = 0
Top = 210
Width = 900
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function Mcisendstring Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrcommand As String, ByVal lpstrreturnstring As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim S As String * 256
Private Sub Form_load()
Dim I As Integer
Text2 = ""
' 打开 CD 设备
Mcisendstring "Open cdaudio alias CDRom", vbNullString, 0, 0
' 得到音轨总数
Mcisendstring "Status CDRom number of tracks", S, Len(S), 0
' 将各音轨编号加入到下拉列表框
For I = 1 To Val(S)
If I > 9 Then
Combo1.AddItem "音轨" + CStr(I)
Else
Combo1.AddItem "音轨" + "0" + CStr(I)
End If
Next I
' 显示总播放时间
Mcisendstring "Status CDRom Length ", S, Len(S), 0
Text1 = Mid(S, 1, 5)
End Sub
Private Sub Combo1_Click()
Dim T As Integer
T = Val(Mid(Combo1.Text, 3, 2))
' 当前音轨的播放时间
Mcisendstring "Status CDRom Length track " & T, S, Len(S), 0
Text2 = Mid(S, 2, 4)
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -