📄 form1.frm
字号:
VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "MSDXM.OCX"
Begin VB.Form Form1
BorderStyle = 0 'None
ClientHeight = 465
ClientLeft = 1515
ClientTop = 1425
ClientWidth = 4395
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 465
ScaleWidth = 4395
ShowInTaskbar = 0 'False
Visible = 0 'False
WindowState = 1 'Minimized
Begin VB.Timer Timer1
Interval = 1000
Left = 630
Top = 30
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
ForeColor = &H00C00000&
Height = 195
Left = 1920
TabIndex = 3
Top = 130
Width = 375
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
ForeColor = &H00C00000&
Height = 195
Left = 1710
TabIndex = 2
Top = 130
Width = 225
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
ForeColor = &H00C00000&
Height = 195
Left = 1350
TabIndex = 1
Top = 130
Width = 375
End
Begin MediaPlayerCtl.MediaPlayer MP1
Height = 1605
Left = 30
TabIndex = 0
Top = -1200
Width = 4335
AudioStream = -1
AutoSize = 0 'False
AutoStart = 0 'False
AnimationAtStart= -1 'True
AllowScan = -1 'True
AllowChangeDisplaySize= -1 'True
AutoRewind = 0 'False
Balance = 0
BaseURL = ""
BufferingTime = 5
CaptioningID = ""
ClickToPlay = -1 'True
CursorType = 0
CurrentPosition = -1
CurrentMarker = 0
DefaultFrame = ""
DisplayBackColor= 12640511
DisplayForeColor= 12582912
DisplayMode = 0
DisplaySize = 4
Enabled = -1 'True
EnableContextMenu= -1 'True
EnablePositionControls= -1 'True
EnableFullScreenControls= 0 'False
EnableTracker = -1 'True
Filename = ""
InvokeURLs = -1 'True
Language = -1
Mute = 0 'False
PlayCount = 1
PreviewMode = 0 'False
Rate = 1
SAMILang = ""
SAMIStyle = ""
SAMIFileName = ""
SelectionStart = -1
SelectionEnd = -1
SendOpenStateChangeEvents= -1 'True
SendWarningEvents= -1 'True
SendErrorEvents = -1 'True
SendKeyboardEvents= 0 'False
SendMouseClickEvents= 0 'False
SendMouseMoveEvents= 0 'False
SendPlayStateChangeEvents= -1 'True
ShowCaptioning = 0 'False
ShowControls = -1 'True
ShowAudioControls= 0 'False
ShowDisplay = 0 'False
ShowGotoBar = 0 'False
ShowPositionControls= 0 'False
ShowStatusBar = -1 'True
ShowTracker = 0 'False
TransparentAtStart= 0 'False
VideoBorderWidth= 0
VideoBorderColor= -2147483644
VideoBorder3D = 0 'False
Volume = 0
WindowlessVideo = 0 'False
End
Begin VB.Menu MenuPOP
Caption = "Menu"
Visible = 0 'False
Begin VB.Menu MnuMenu
Caption = "退出程序"
Index = 0
End
Begin VB.Menu MnuMenu
Caption = "-"
Index = 1
End
Begin VB.Menu MnuMenu
Caption = "关于...."
Index = 2
End
Begin VB.Menu MnuMenu
Caption = "添加列表"
Index = 3
End
Begin VB.Menu MnuMenu
Caption = "-"
Index = 4
End
Begin VB.Menu MnuMenu
Caption = "自动重复"
Index = 5
End
Begin VB.Menu MnuMenu
Caption = "歌曲预览"
Index = 6
End
Begin VB.Menu MnuMenu
Caption = "静 音"
Index = 7
End
Begin VB.Menu MnuMenu
Caption = "-"
Index = 8
End
Begin VB.Menu MnuMenu
Caption = "到上一首"
Index = 9
End
Begin VB.Menu MnuMenu
Caption = "到下一首"
Index = 10
End
Begin VB.Menu MnuMenu
Caption = "暂停播放"
Index = 11
End
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_Click()
Me.Hide
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim Msg As String
If App.PrevInstance Then '检查前一版本
Msg = MsgBox("本程序已经运行了!", vbOKOnly, "提示")
End
End If
Move (Screen.Width - Me.Width), (Screen.Height - Me.Height - 410)
Timer1.Enabled = True
With nfIconData
.hwnd = Me.hwnd
.uID = Me.Icon
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon.Handle
.szTip = "袖珍MP3播放器1.0C" & Chr$(0)
.cbSize = Len(nfIconData)
End With
Call Shell_NotifyIcon(NIM_ADD, nfIconData)
MP1.FileName = "SmPlay.m3u"
MP1.AutoStart = True
Unload Start1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Select Case x
Case 7695 '鼠标左键按下
If MP1.FileName = "" Then
Me.Hide
Else
Me.WindowState = 0
Me.Show
End If
Case 7740 '鼠标右键按下
PopupMenu MenuPOP
End Select
End Sub
Private Sub Label1_Click()
Me.Hide
End Sub
Private Sub Label2_Click()
Me.Hide
End Sub
Private Sub Label3_Click()
Me.Hide
End Sub
Private Sub MnuMenu_Click(Index As Integer)
Dim Msg1 As String
On Error Resume Next
Select Case Index
Case 0
MP1.Stop
Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
Unload Me
End
Case 2
Msg1 = " 袖珍MP3播放器 Ver 1.0C" & Chr(10) & Chr(10) & " 编程语言:MicroSoft Visual Basic 6.0" & Chr(10) & Chr(10) & " 核心控件:6.01以上MicroSoft Media Player " & Chr(10) & Chr(10) & " 编制:李晓金" & Chr(10) & Chr(10) & " E-mail:instshop@21cn.com" & Chr(10) & Chr(10) & " http://kahn.xj.cninfo.net/insttool"
MsgBox Msg1, 0, "关于MP3播放器"
Case 3
Form2.Show
Case 5
If MnuMenu(5).Checked = False Then
MP1.PlayCount = 0
MnuMenu(5).Checked = True
Else
MP1.PlayCount = 1
MnuMenu(5).Checked = False
End If
Case 6
If MnuMenu(6).Checked = False Then
MP1.PreviewMode = True
MnuMenu(6).Checked = True
Else
MP1.PreviewMode = False
MnuMenu(6).Checked = False
End If
Case 7
If MnuMenu(7).Checked = False Then
MP1.Mute = True
MnuMenu(7).Checked = True
Else
MP1.Mute = False
MnuMenu(7).Checked = False
End If
Case 9
MP1.Previous
Case 10
MP1.Next
Case 11
If MnuMenu(11).Checked = False Then
MP1.Pause
MnuMenu(11).Checked = True
Else
MP1.Play
MnuMenu(11).Checked = False
End If
End Select
End Sub
Private Sub Timer1_Timer()
Dim ICount, ITotal As Integer
ICount = MP1.GetCurrentEntry
ITotal = MP1.EntryCount
Label1.Caption = ICount
Label2.Caption = "/"
Label3.Caption = ITotal
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -