VERSION 5.00
Object = "{C1A8AF28-1257-101B-8FB0-0020AF039CA3}#1.1#0"; "MCI32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "退  出"
      Height          =   375
      Left            =   2760
      TabIndex        =   2
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开文件"
      Height          =   375
      Left            =   480
      TabIndex        =   1
      Top             =   2760
      Width           =   1215
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   585
      Top             =   1545
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MCI.MMControl MMControl1 
      Height          =   420
      Left            =   240
      TabIndex        =   0
      Top             =   2280
      Width           =   4065
      _ExtentX        =   7170
      _ExtentY        =   741
      _Version        =   393216
      DeviceType      =   ""
      FileName        =   ""
   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 Command1_Click()

    CommonDialog1.ShowOpen              '打开"打开"对话框
    MMControl1.Orientation = mciOrientHorz         '控件按钮水平排列
    MMControl1.DeviceType = "AVIVideo"             '指定MCI设备的类型为AVI播放器
    MMControl1.Notify = False                      '使Multimedia MCI控件不发出回调信息
    MMControl1.Shareable = False                   '指定多媒体设备不能共享
    MMControl1.Wait = True                         '在前一命令完成之前，控件不可用
    MMControl1.FileName = CommonDialog1.FileName   '设定播放文件和路径
    MMControl1.Command = "Open"                    '激活Multimedia控件中的按钮
    
End Sub

Private Sub Command2_Click()
    End
End Sub

Private Sub Form_Load()
    CommonDialog1.Filter = "全部文件|*.*|AVI视频文件|*.AVI"    '设置"打开"对话框的文件过滤
End Sub

Private Sub Form_Unload(Cancel As Integer)
    MMControl1.Command = "Close"            '关闭MCI设备
End Sub

