home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / mikofi_1 / frmtestf.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-05-30  |  7.8 KB  |  243 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTestFileInfo 
  3.    Caption         =   "Testing File Info ActiveX DLL"
  4.    ClientHeight    =   6015
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   8970
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   6015
  10.    ScaleWidth      =   8970
  11.    StartUpPosition =   2  'CenterScreen
  12.    Begin VB.PictureBox picShellIcon 
  13.       AutoRedraw      =   -1  'True
  14.       BorderStyle     =   0  'None
  15.       Height          =   495
  16.       Index           =   5
  17.       Left            =   4800
  18.       ScaleHeight     =   495
  19.       ScaleWidth      =   495
  20.       TabIndex        =   14
  21.       Top             =   5400
  22.       Width           =   495
  23.    End
  24.    Begin VB.PictureBox picShellIcon 
  25.       AutoRedraw      =   -1  'True
  26.       BorderStyle     =   0  'None
  27.       Height          =   495
  28.       Index           =   4
  29.       Left            =   3840
  30.       ScaleHeight     =   495
  31.       ScaleWidth      =   495
  32.       TabIndex        =   13
  33.       Top             =   5400
  34.       Width           =   495
  35.    End
  36.    Begin VB.PictureBox picShellIcon 
  37.       AutoRedraw      =   -1  'True
  38.       BorderStyle     =   0  'None
  39.       Height          =   495
  40.       Index           =   3
  41.       Left            =   2880
  42.       ScaleHeight     =   495
  43.       ScaleWidth      =   495
  44.       TabIndex        =   12
  45.       Top             =   5400
  46.       Width           =   495
  47.    End
  48.    Begin VB.PictureBox picIcon 
  49.       AutoRedraw      =   -1  'True
  50.       BorderStyle     =   0  'None
  51.       Height          =   615
  52.       Index           =   1
  53.       Left            =   7200
  54.       ScaleHeight     =   615
  55.       ScaleWidth      =   735
  56.       TabIndex        =   11
  57.       Top             =   4680
  58.       Width           =   735
  59.    End
  60.    Begin VB.HScrollBar hsIcon 
  61.       Height          =   255
  62.       Left            =   6120
  63.       TabIndex        =   10
  64.       Top             =   5520
  65.       Width           =   1935
  66.    End
  67.    Begin VB.PictureBox picIcon 
  68.       AutoRedraw      =   -1  'True
  69.       BorderStyle     =   0  'None
  70.       Height          =   615
  71.       Index           =   0
  72.       Left            =   6240
  73.       ScaleHeight     =   615
  74.       ScaleWidth      =   735
  75.       TabIndex        =   9
  76.       Top             =   4680
  77.       Width           =   735
  78.    End
  79.    Begin VB.PictureBox picShellIcon 
  80.       AutoRedraw      =   -1  'True
  81.       BorderStyle     =   0  'None
  82.       Height          =   615
  83.       Index           =   2
  84.       Left            =   4680
  85.       ScaleHeight     =   615
  86.       ScaleWidth      =   735
  87.       TabIndex        =   7
  88.       Top             =   4680
  89.       Width           =   735
  90.    End
  91.    Begin VB.PictureBox picShellIcon 
  92.       AutoRedraw      =   -1  'True
  93.       BorderStyle     =   0  'None
  94.       Height          =   615
  95.       Index           =   1
  96.       Left            =   3720
  97.       ScaleHeight     =   615
  98.       ScaleWidth      =   735
  99.       TabIndex        =   6
  100.       Top             =   4680
  101.       Width           =   735
  102.    End
  103.    Begin VB.PictureBox picShellIcon 
  104.       AutoRedraw      =   -1  'True
  105.       BorderStyle     =   0  'None
  106.       Height          =   615
  107.       Index           =   0
  108.       Left            =   2760
  109.       ScaleHeight     =   615
  110.       ScaleWidth      =   735
  111.       TabIndex        =   4
  112.       Top             =   4680
  113.       Width           =   735
  114.    End
  115.    Begin VB.ListBox lstInfo 
  116.       BeginProperty Font 
  117.          Name            =   "Courier New"
  118.          Size            =   8.25
  119.          Charset         =   0
  120.          Weight          =   400
  121.          Underline       =   0   'False
  122.          Italic          =   0   'False
  123.          Strikethrough   =   0   'False
  124.       EndProperty
  125.       Height          =   3840
  126.       Left            =   2400
  127.       TabIndex        =   3
  128.       Top             =   240
  129.       Width           =   6495
  130.    End
  131.    Begin VB.FileListBox lstfile 
  132.       Height          =   3405
  133.       Left            =   0
  134.       TabIndex        =   2
  135.       Top             =   2520
  136.       Width           =   2295
  137.    End
  138.    Begin VB.DirListBox lstDir 
  139.       Height          =   1890
  140.       Left            =   0
  141.       TabIndex        =   1
  142.       Top             =   600
  143.       Width           =   2295
  144.    End
  145.    Begin VB.DriveListBox cboDrive 
  146.       Height          =   315
  147.       Left            =   0
  148.       TabIndex        =   0
  149.       Top             =   240
  150.       Width           =   2295
  151.    End
  152.    Begin VB.Label lbl 
  153.       AutoSize        =   -1  'True
  154.       Caption         =   "Internal Icons"
  155.       Height          =   195
  156.       Index           =   1
  157.       Left            =   6240
  158.       TabIndex        =   8
  159.       Top             =   4320
  160.       Width           =   960
  161.    End
  162.    Begin VB.Label lbl 
  163.       AutoSize        =   -1  'True
  164.       Caption         =   "Shell Icons"
  165.       Height          =   195
  166.       Index           =   0
  167.       Left            =   2760
  168.       TabIndex        =   5
  169.       Top             =   4320
  170.       Width           =   780
  171.    End
  172. Attribute VB_Name = "frmTestFileInfo"
  173. Attribute VB_GlobalNameSpace = False
  174. Attribute VB_Creatable = False
  175. Attribute VB_PredeclaredId = True
  176. Attribute VB_Exposed = False
  177. Option Explicit
  178. Dim F As FileInfo
  179. Private Sub Form_Load()
  180.     Set F = New FileInfo
  181.     If Dir("C:\Windows\*.*") <> "" Then
  182.         lstDir.Path = "C:\Windows"
  183.     End If
  184. End Sub
  185. Private Sub Form_Unload(Cancel As Integer)
  186.     Set F = Nothing
  187. End Sub
  188. Private Sub cboDrive_Change()
  189.     lstDir.Path = cboDrive.Drive
  190. End Sub
  191. Private Sub lstDir_Change()
  192.     lstfile.Path = lstDir.Path
  193. End Sub
  194. Private Sub lstfile_Click()
  195.     If Right(lstfile.Path, 1) = "\" Then
  196.         F.File = lstfile.Path + lstfile.FileName
  197.     Else
  198.         F.File = lstfile.Path + "\" + lstfile.FileName
  199.     End If
  200.     lstInfo.Clear
  201.     lstInfo.AddItem "FILE:          " & F.File
  202.     lstInfo.AddItem "NAME:          " & F.Name
  203.     lstInfo.AddItem "PATH:          " & F.Path
  204.     lstInfo.AddItem "EXT:           " & F.Ext
  205.     lstInfo.AddItem "DATETIME:      " & F.DateTime(dtModified)
  206.     lstInfo.AddItem "FILE SIZE:     " & F.FileSize(spcKiloBytes, spcString)
  207.     lstInfo.AddItem ""
  208.     lstInfo.AddItem "SHELL NAME:    " & F.ShellDisplayName
  209.     lstInfo.AddItem "SHELL TYPE:    " & F.ShellTypeName
  210.     lstInfo.AddItem ""
  211.     hsIcon.Min = 0
  212.     If F.Icons > 0 Then
  213.         hsIcon.Min = 1
  214.         hsIcon.Value = 1
  215.         hsIcon.Max = F.Icons
  216.         Set picIcon(0).Picture = F.Icon(0, icLarge)
  217.         Set picIcon(1).Picture = F.Icon(0, icSmall)
  218.     Else
  219.         hsIcon.Max = 0
  220.         Set picIcon(0) = LoadPicture
  221.         Set picIcon(1) = LoadPicture
  222.     End If
  223.     Set picShellIcon(0).Picture = F.ShellIcon(icLarge, shNormal)
  224.     Set picShellIcon(1).Picture = F.ShellIcon(icLarge, shSelected)
  225.     Set picShellIcon(2).Picture = F.ShellIcon(icLarge, shLinkOverlay)
  226.     Set picShellIcon(3).Picture = F.ShellIcon(icSmall, shNormal)
  227.     Set picShellIcon(4).Picture = F.ShellIcon(icSmall, shSelected)
  228.     Set picShellIcon(5).Picture = F.ShellIcon(icSmall, shLinkOverlay)
  229.     'Must call Refresh method to obtain information from file
  230.     'Refreshing everytime you assign a file would be slow.
  231.     'This way we only Refresh when we need FileVersion or FileInformation
  232.     F.Refresh
  233.     lstInfo.AddItem "VERSION:       " & F.FileVersion
  234.     lstInfo.AddItem "COMPANY:       " & F.FileInformation(inCompanyName)
  235.     lstInfo.AddItem "DESCRIPTION:   " & F.FileInformation(inFileDescription)
  236.     lstInfo.AddItem "PRODUCT:       " & F.FileInformation(inProductName)
  237.     lstInfo.AddItem "COPYRIGHT:     " & F.FileInformation(inLegalCopyright)
  238. End Sub
  239. Private Sub hsIcon_Change()
  240.     Set picIcon(0).Picture = F.Icon(hsIcon.Value - 1, icLarge)
  241.     Set picIcon(1).Picture = F.Icon(hsIcon.Value - 1, icSmall)
  242. End Sub
  243.