home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmTestFileInfo
- Caption = "Testing File Info ActiveX DLL"
- ClientHeight = 6015
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8970
- LinkTopic = "Form1"
- ScaleHeight = 6015
- ScaleWidth = 8970
- StartUpPosition = 2 'CenterScreen
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 495
- Index = 5
- Left = 4800
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 14
- Top = 5400
- Width = 495
- End
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 495
- Index = 4
- Left = 3840
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 13
- Top = 5400
- Width = 495
- End
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 495
- Index = 3
- Left = 2880
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 12
- Top = 5400
- Width = 495
- End
- Begin VB.PictureBox picIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 615
- Index = 1
- Left = 7200
- ScaleHeight = 615
- ScaleWidth = 735
- TabIndex = 11
- Top = 4680
- Width = 735
- End
- Begin VB.HScrollBar hsIcon
- Height = 255
- Left = 6120
- TabIndex = 10
- Top = 5520
- Width = 1935
- End
- Begin VB.PictureBox picIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 615
- Index = 0
- Left = 6240
- ScaleHeight = 615
- ScaleWidth = 735
- TabIndex = 9
- Top = 4680
- Width = 735
- End
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 615
- Index = 2
- Left = 4680
- ScaleHeight = 615
- ScaleWidth = 735
- TabIndex = 7
- Top = 4680
- Width = 735
- End
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 615
- Index = 1
- Left = 3720
- ScaleHeight = 615
- ScaleWidth = 735
- TabIndex = 6
- Top = 4680
- Width = 735
- End
- Begin VB.PictureBox picShellIcon
- AutoRedraw = -1 'True
- BorderStyle = 0 'None
- Height = 615
- Index = 0
- Left = 2760
- ScaleHeight = 615
- ScaleWidth = 735
- TabIndex = 4
- Top = 4680
- Width = 735
- End
- Begin VB.ListBox lstInfo
- BeginProperty Font
- Name = "Courier New"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 3840
- Left = 2400
- TabIndex = 3
- Top = 240
- Width = 6495
- End
- Begin VB.FileListBox lstfile
- Height = 3405
- Left = 0
- TabIndex = 2
- Top = 2520
- Width = 2295
- End
- Begin VB.DirListBox lstDir
- Height = 1890
- Left = 0
- TabIndex = 1
- Top = 600
- Width = 2295
- End
- Begin VB.DriveListBox cboDrive
- Height = 315
- Left = 0
- TabIndex = 0
- Top = 240
- Width = 2295
- End
- Begin VB.Label lbl
- AutoSize = -1 'True
- Caption = "Internal Icons"
- Height = 195
- Index = 1
- Left = 6240
- TabIndex = 8
- Top = 4320
- Width = 960
- End
- Begin VB.Label lbl
- AutoSize = -1 'True
- Caption = "Shell Icons"
- Height = 195
- Index = 0
- Left = 2760
- TabIndex = 5
- Top = 4320
- Width = 780
- End
- Attribute VB_Name = "frmTestFileInfo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim F As FileInfo
- Private Sub Form_Load()
- Set F = New FileInfo
- If Dir("C:\Windows\*.*") <> "" Then
- lstDir.Path = "C:\Windows"
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set F = Nothing
- End Sub
- Private Sub cboDrive_Change()
- lstDir.Path = cboDrive.Drive
- End Sub
- Private Sub lstDir_Change()
- lstfile.Path = lstDir.Path
- End Sub
- Private Sub lstfile_Click()
- If Right(lstfile.Path, 1) = "\" Then
- F.File = lstfile.Path + lstfile.FileName
- Else
- F.File = lstfile.Path + "\" + lstfile.FileName
- End If
- lstInfo.Clear
- lstInfo.AddItem "FILE: " & F.File
- lstInfo.AddItem "NAME: " & F.Name
- lstInfo.AddItem "PATH: " & F.Path
- lstInfo.AddItem "EXT: " & F.Ext
- lstInfo.AddItem "DATETIME: " & F.DateTime(dtModified)
- lstInfo.AddItem "FILE SIZE: " & F.FileSize(spcKiloBytes, spcString)
- lstInfo.AddItem ""
- lstInfo.AddItem "SHELL NAME: " & F.ShellDisplayName
- lstInfo.AddItem "SHELL TYPE: " & F.ShellTypeName
- lstInfo.AddItem ""
- hsIcon.Min = 0
- If F.Icons > 0 Then
- hsIcon.Min = 1
- hsIcon.Value = 1
- hsIcon.Max = F.Icons
- Set picIcon(0).Picture = F.Icon(0, icLarge)
- Set picIcon(1).Picture = F.Icon(0, icSmall)
- Else
- hsIcon.Max = 0
- Set picIcon(0) = LoadPicture
- Set picIcon(1) = LoadPicture
- End If
- Set picShellIcon(0).Picture = F.ShellIcon(icLarge, shNormal)
- Set picShellIcon(1).Picture = F.ShellIcon(icLarge, shSelected)
- Set picShellIcon(2).Picture = F.ShellIcon(icLarge, shLinkOverlay)
- Set picShellIcon(3).Picture = F.ShellIcon(icSmall, shNormal)
- Set picShellIcon(4).Picture = F.ShellIcon(icSmall, shSelected)
- Set picShellIcon(5).Picture = F.ShellIcon(icSmall, shLinkOverlay)
- 'Must call Refresh method to obtain information from file
- 'Refreshing everytime you assign a file would be slow.
- 'This way we only Refresh when we need FileVersion or FileInformation
- F.Refresh
- lstInfo.AddItem "VERSION: " & F.FileVersion
- lstInfo.AddItem "COMPANY: " & F.FileInformation(inCompanyName)
- lstInfo.AddItem "DESCRIPTION: " & F.FileInformation(inFileDescription)
- lstInfo.AddItem "PRODUCT: " & F.FileInformation(inProductName)
- lstInfo.AddItem "COPYRIGHT: " & F.FileInformation(inLegalCopyright)
- End Sub
- Private Sub hsIcon_Change()
- Set picIcon(0).Picture = F.Icon(hsIcon.Value - 1, icLarge)
- Set picIcon(1).Picture = F.Icon(hsIcon.Value - 1, icSmall)
- End Sub
-