VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0"; "MSCOMCTL.OCX"
Begin VB.Form Form3 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "选择"
   ClientHeight    =   7485
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   13290
   BeginProperty Font 
      Name            =   "微软雅黑"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Form3.frx":0000
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7485
   ScaleWidth      =   13290
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   5640
      TabIndex        =   7
      Top             =   6840
      Visible         =   0   'False
      Width           =   2535
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   600
      Top             =   4680
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   30
      ImageHeight     =   28
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   2
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form3.frx":628A
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form3.frx":951F
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.FileListBox File1 
      Height          =   3690
      Left            =   7320
      TabIndex        =   6
      Top             =   1320
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.DirListBox Dir1 
      Height          =   4050
      Left            =   3960
      TabIndex        =   5
      Top             =   1320
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Text            =   "Text1"
      Top             =   6840
      Visible         =   0   'False
      Width           =   5175
   End
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   495
      Left            =   9230
      TabIndex        =   3
      Top             =   6840
      Width           =   1935
   End
   Begin VB.CommandButton Command3 
      Caption         =   "取消"
      Height          =   495
      Left            =   11160
      TabIndex        =   2
      Top             =   6840
      Width           =   1935
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   6615
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2895
      _ExtentX        =   5106
      _ExtentY        =   11668
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      SmallIcons      =   "ImageList1"
      ColHdrIcons     =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin MSComctlLib.ListView ListView2 
      Height          =   6615
      Left            =   3120
      TabIndex        =   1
      Top             =   120
      Width           =   9975
      _ExtentX        =   17595
      _ExtentY        =   11668
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      SmallIcons      =   "ImageList1"
      ColHdrIcons     =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.Menu MM 
      Caption         =   "菜单"
      Visible         =   0   'False
      Begin VB.Menu M1 
         Caption         =   "打开文件夹"
      End
      Begin VB.Menu M2 
         Caption         =   "返回上一级"
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command2_Click()
If ListView1.ListItems.Count > 0 Then
    If ListView1.SelectedItem.Index > 0 Then

    Form1.ListView2.ListItems.Clear
    For i = 1 To ListView2.ListItems.Count
        Form1.ListView2.ListItems.Add , , ListView2.ListItems(i).text, 1, 1
    Next
    Form1.Text1.text = Text1.text & Text2.text & "\" & ListView1.SelectedItem.text
    iniPath$ = App.Path & "\Setting\" & Form1.ListView1.SelectedItem.text & ".ini"
    entry = Text1.text & Text2.text & "\" & ListView1.SelectedItem.text: r = WritePrivateProfileString("Setting", "File", entry, iniPath)
    Unload Me
    End If

End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
On Error Resume Next
Me.KeyPreview = True
With ListView1
    .ColumnHeaders.Clear
    .View = lvwReport
    .LabelEdit = 1
    .HideColumnHeaders = False
    .FullRowSelect = True
    .GridLines = True
    .ListItems.Clear
    .ColumnHeaders.Add 1, , "项目", ListView1.Width - 335
End With
With ListView2
    .ColumnHeaders.Clear
    .View = lvwReport
    .LabelEdit = 1
    .HideColumnHeaders = False
    .FullRowSelect = True
    .GridLines = True
    .ListItems.Clear
    .ColumnHeaders.Add 1, , "项目", ListView2.Width - 335
End With

If Dir(App.Path & "\Setting\" & "Setting.ini") <> "" Then
iniPath$ = App.Path & "\Setting\" & "Setting.ini"
Text1.text = GetFromINI("Setting", "MovieFile", iniPath)
Dir1.Path = Text1.text
Dir1.Refresh
For i = 0 To Dir1.ListCount - 1
ListView1.ListItems.Add , , Replace(Dir1.List(i), Text1.text & "\", ""), 2, 2
Next
End If
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
Unload Me
End If
End Sub

Private Sub ListView1_Click()
If ListView1.ListItems.Count > 0 Then
    If ListView1.SelectedItem.Index > 0 Then
        ListView2.ListItems.Clear
        ListView2.ColumnHeaders(1).text = Replace(Dir1.List(ListView1.SelectedItem.Index - 1), Text1.text & "\", "")
        File1.Path = Text1.text & Text2.text & "\" & ListView1.SelectedItem.text
        File1.Refresh
        For i = 0 To File1.ListCount - 1
            ListView2.ListItems.Add , , File1.List(i), 1, 1
        Next
    End If
End If
End Sub

Private Sub ListView1_DblClick()
If ListView1.ListItems.Count > 0 Then
    If ListView1.SelectedItem.Index > 0 Then
        Command2_Click
    End If
End If
End Sub

Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
    If ListView1.ListItems.Count > 0 Then
    If ListView1.SelectedItem.Index > 0 Then
        M1.Visible = True
        PopupMenu MM
        

    End If
    Else
        M1.Visible = False
        PopupMenu MM
        

        
    End If
End If
End Sub

Private Sub M1_Click()
Text2.text = Text2.text & "\" & ListView1.SelectedItem.text
Dir1.Path = Text1.text & Text2.text
Dir1.Refresh
ListView1.ListItems.Clear
ListView2.ListItems.Clear
For i = 0 To Dir1.ListCount - 1
ListView1.ListItems.Add , , Replace(Dir1.List(i), Text1.text & Text2.text & "\", ""), 2, 2
Next

End Sub

Private Sub M2_Click()
Dim Nr As String
If Text2.text = "" Then
MsgBox "已是根目录!", vbCritical + vbOKOnly, "提示"
Else
If InStrRev(Text2.text, "\") = 1 Then
Nr = ""
Else
Nr = Mid(Text2.text, 1, InStrRev(Text2.text, "\") - 1)
End If
Text2.text = Nr
Dir1.Path = Text1.text & Text2.text
Dir1.Refresh
ListView1.ListItems.Clear
ListView2.ListItems.Clear
For i = 0 To Dir1.ListCount - 1
ListView1.ListItems.Add , , Replace(Dir1.List(i), Text1.text & Text2.text & "\", ""), 2, 2
Next


End If
End Sub

