【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“正在播放.frm”一文,供大家参考学习!
VERSION 5.00
Begin VB.Form Form2
Caption = "视频窗口"
ClientHeight = 3555
ClientLeft = 2175
ClientTop = 1440
ClientWidth = 5370
FillColor = &H00E0E0E0&
ForeColor = &H8000000E&
Icon = "正在播放.frx":0000
LinkTopic = "Form2"
ScaleHeight = 3555
ScaleWidth = 5370
Begin VB.PictureBox Picture1
AutoSize = -1 'True
Height = 6615
Left = 0
ScaleHeight = 6555
ScaleWidth = 7035
TabIndex = 0
Top = -2880
Width = 7095
End
Begin VB.Menu My
Caption = "Mypopu"
Begin VB.Menu Fullsct
Caption = "全屏幕"
End
Begin
VB.Menu Smallscr
Caption = "小屏幕"
End
Begin VB.Menu Minscr
Caption = "最小化"
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'声明API函数
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Declare Function mciSendCommand Lib "winmm.dll" Alias "mciSendCommandA" (ByVal wDeviceID As Long, ByVal uMessage As Long, ByVal dwParam1 As Long, dwParam2 As MCI_OVLY_RECT_PARMS) As Long
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
'声明API中表示矩形的结构类型
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'声明API中结构类型MCI_OVLY_RECT_PARMS
Private Type MCI_OVLY_RECT_PARMS
dwCallback As Long
rc As RECT
End Type
'声明API中常量
Const MCI_OVLY_WHERE_SOURCE = &H20000
Const MCI_OVLY_WHERE_DESTINATION = &H40000
Const MCI_WHERE = &H843
'鼠标在窗体上按下事件
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu My '调用菜单My
End If
End Sub
Private Sub Form_Resize()
On Error GoTo Number2:
Picture1.Left = Form2.ScaleLeft '设置图片框Picture1的左边位置
Picture1.Top = Form2.ScaleTop '设置图片框Picture1的顶部位置
Picture1.Width = Form2.ScaleWidth '设置图片框Picture1的宽度
Picture1.Height = Form2.ScaleHeight '设置图片框Picture1的高度
Exit Sub '退出过程
Number2:
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.MMControl1.Command = "Close" '关闭
Unload Me '卸载窗体
Set Form2 = Nothing '设置窗体Form2为空
Form1.Show '显示窗体Form1
End Sub
'全屏幕的事件
Private Sub Fullsct_Click()
Dim R&
Dim SNum As String '定义字符串变量
SNum = Space$(255) '获得空格组成的字符串
R = GetShortPathName(Form1.MMControl1.FileName, SNum, Len(SNum)) '获取指定文件的短路径名
SNum = Mid$(SNum, 1, R)
R = mciSendString("play " & SNum & " fullscreen ", 0&, 0, 0&) '发送全屏的信息
End Sub
'最小化的事件
Private Sub Minscr_Click()
Form2.WindowState = 1 '设置窗体Form2的窗口状态
End Sub
'图片框Picture1的点击事件
Private Sub Picture1_Click()
Static Flag As Byte '定义字节类型变量
Flag = Flag + 1 '字节类型变量加1
If Flag Mod 2 = 1 Then '当字节类型变量为奇数时
Form1.Hide '隐藏窗体Form1
Else '当字节类型变量为偶数时
Form1.Show '显示窗体Form1
End If
End Sub
'鼠标在图片框Picture1上释放的事件
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu My '调用菜单My
End If
End Sub
'小屏幕的事件
Private Sub Smallscr_Click()
Form2.WindowState = 0 '设置窗体Form2的窗口状态
End Sub