VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Открывашка"
   ClientHeight    =   4830
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7125
   LinkTopic       =   "Form1"
   ScaleHeight     =   4830
   ScaleWidth      =   7125
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox CboFileType 
      Height          =   315
      ItemData        =   "Открывашка.frx":0000
      Left            =   4800
      List            =   "Открывашка.frx":0002
      Style           =   2  'Dropdown List
      TabIndex        =   6
      Top             =   2760
      Width           =   2175
   End
   Begin VB.FileListBox filfiles 
      Height          =   1845
      Left            =   120
      TabIndex        =   5
      Top             =   1680
      Width           =   2055
   End
   Begin VB.DirListBox DirDirectory 
      Height          =   1890
      Left            =   2280
      TabIndex        =   4
      Top             =   1680
      Width           =   2415
   End
   Begin VB.DriveListBox drvDrive 
      Height          =   315
      Left            =   4800
      TabIndex        =   3
      Top             =   1680
      Width           =   2175
   End
   Begin VB.CommandButton open 
      Caption         =   "Открыть"
      Height          =   375
      Left            =   4320
      TabIndex        =   2
      Top             =   4200
      Width           =   975
   End
   Begin VB.TextBox txtFileName 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   120
      TabIndex        =   1
      Top             =   360
      Width           =   3735
   End
   Begin VB.CommandButton Comexit 
      Caption         =   "Выкл"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5640
      TabIndex        =   0
      Top             =   4200
      Width           =   975
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "Открывашка"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3840
      TabIndex        =   8
      Top             =   360
      Width           =   2895
   End
   Begin VB.Label lblDirName 
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   120
      TabIndex        =   7
      Top             =   1080
      Width           =   6615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub CboFileType_Click()
Select Case CboFileType.ListIndex
Case 0
filfiles.Pattern = "*.*"

Case 1
filfiles.Pattern = "*.txt"

Case 2
filfiles.Pattern = "*.Doc*"
Case 3
filfiles.Pattern = "*.exe"
Case 4
filfiles.Pattern = "*.frm"
Case 5
filfiles.Pattern = "*.dll"
Case 6
filfiles.Pattern = "*.bmp"
Case 7
filfiles.Pattern = "*.jpg"
Case 8
filfiles.Pattern = "*.gif"
Case 9
filfiles.Pattern = "*.wav"
Case 10
filfiles.Pattern = "*.mp3"

End Select

End Sub

Private Sub Comexit_Click()
End
End Sub


Private Sub Drive1_Change()
On Error GoTo Drive1Error
DirDirectory.path = drvDrive.Drive
Exit Sub

Drive1Error:
MsgBox "Ошибка выбора устройства", vbExclamation, "Ошибка"
drvDrive = dirdrive.path
Exit Sub

End Sub

Private Sub drvDrive_Change()
DirDirectory.path = drvDrive.Drive
On Error GoTo DriveError
DirDirectory.path = drvDrive.Drive + "\" + filfiles.FileName
Exit Sub

DriveError:
MsgBox "Ошибка выбора устройства", vbExclamation, "Ошибка"
drvDrive = dirdrive.path
Exit Sub

End Sub

Private Sub filfiles_Click()
txtFileName.Text = filfiles.FileName

lblDirName.Caption = DirDirectory.path + "\" + filfiles.FileName

End Sub
Private Sub filfiles_DblClick()
txtFileName.Text = filfiles.FileName

If filfiles.Pattern = "*.exe" Then
filfiles.path = DirDirectory.path
Interaction.Shell (filfiles.path + "\" + filfiles.FileName)
End If

'cmdOk_Click
End Sub

Private Sub Form_Load()
CboFileType.AddItem "Все файлы(*.*) "
CboFileType.AddItem "Текстовые файлы(*.txt) "
CboFileType.AddItem "Документы Word(*.doc)"
CboFileType.AddItem "Программы(*.exe)"
CboFileType.AddItem "VBasic prog(*.frm)"
CboFileType.AddItem "Библиотеки(*.dll)"
CboFileType.AddItem "Графика(*.bmp)"
CboFileType.AddItem "Графика(*.jpg)"
CboFileType.AddItem "Графика(*.gif)"
CboFileType.AddItem "Звук(*.wav)"
CboFileType.AddItem "Звук(*.mp3)"
CboFileType.ListIndex = 0
lblDirName.Caption = DirDirectory.path

End Sub
Private Sub cmdOk_Click()
Dim PathAndName As String
Dim FileSize As String
Dim path As String

If txtFileName.Text = "" Then
MsgBox "Файл не выбран!"
Exit Sub
End If

If Right(filfiles.path, 1) <> "\" Then
path = filfiles.path + "\"
Else
path = filfiles.path
End If

If txtFileName.Text = filfiles.FileName Then
PathAndName = path + filfiles.FileName
Else
PathAndName = txtFilName.Text
End If
On Error GoTo FileLEnError
FileSize = Str(FileLen(PathAndName))
MsgBox "Размер файла " + PathAndName + ":" + FileSize + "bites"
Exit Sub

FileLEnError:
MsgBox " Не могу определит размер файла" + PathAndName
Exit Sub
End Sub

Private Sub DirDirectory_Change()
filfiles.path = DirDirectory.path
lblDirName.Caption = DirDirectory.path
End Sub

Private Sub OLE3_Updated(Code As Integer)

End Sub

Private Sub OLE1_Updated(Code As Integer)

End Sub

Private Sub open_Click()
'DirDirectory.path = drvDrive.Drive
'filfiles.path = filfiles.FileName
'If DirDirectory.path = "C:\" Then
'Interaction.Shell (filfiles.FileName)
'End If
If filfiles.Pattern = "*.txt" Then
filfiles.FileName = "C:\WINDOWS\system32\notepad.exe"
Interaction.Shell (filfiles.FileName)
End If

If filfiles.Pattern = "*.exe" Then
filfiles.path = DirDirectory.path
Interaction.Shell (filfiles.path + "\" + filfiles.FileName)
End If

If filfiles.Pattern = "*.Doc*" Then
filfiles.FileName = "C:\Program Files\Microsoft Office\Office10\Winword.exe"
Interaction.Shell (filfiles.FileName)
AppActivate (FileName)
End If
'Interaction.Shell (filfiles.path + "\" + filfiles.FileName)

lblDirName.Caption = filfiles.path + "\" + filfiles.FileName
End Sub

