home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / FolderView1195788182002.psc / FolderViewListViewDemo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-08-07  |  23.2 KB  |  619 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Begin VB.Form frmFvLvDemo 
  4.    AutoRedraw      =   -1  'True
  5.    Caption         =   "FolderView Active-X, Listview Demo"
  6.    ClientHeight    =   7530
  7.    ClientLeft      =   60
  8.    ClientTop       =   405
  9.    ClientWidth     =   10875
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   502
  12.    ScaleMode       =   3  'Pixel
  13.    ScaleWidth      =   725
  14.    StartUpPosition =   1  'CenterOwner
  15.    WindowState     =   2  'Maximized
  16.    Begin FvLvDemo.Splitter Splitter1 
  17.       Height          =   7635
  18.       Left            =   60
  19.       TabIndex        =   1
  20.       Top             =   60
  21.       Width           =   11775
  22.       _ExtentX        =   20770
  23.       _ExtentY        =   13467
  24.       RatioFromTop    =   0.33
  25.       Child1          =   "FolderView1"
  26.       Child2          =   "ListView1"
  27.       LiveUpdate      =   0   'False
  28.       Begin FvLvDemo.FolderView FolderView1 
  29.          Height          =   7575
  30.          Left            =   0
  31.          TabIndex        =   3
  32.          Top             =   0
  33.          Width           =   3735
  34.          _ExtentX        =   6588
  35.          _ExtentY        =   13361
  36.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  37.             Name            =   "MS Sans Serif"
  38.             Size            =   8.25
  39.             Charset         =   0
  40.             Weight          =   400
  41.             Underline       =   0   'False
  42.             Italic          =   0   'False
  43.             Strikethrough   =   0   'False
  44.          EndProperty
  45.          MouseIcon       =   "FolderViewListViewDemo.frx":0000
  46.          BackColor       =   12632256
  47.       End
  48.       Begin MSComctlLib.ListView ListView1 
  49.          Height          =   7605
  50.          Left            =   3990
  51.          TabIndex        =   2
  52.          Top             =   -15
  53.          Width           =   7740
  54.          _ExtentX        =   13653
  55.          _ExtentY        =   13414
  56.          View            =   3
  57.          MultiSelect     =   -1  'True
  58.          LabelWrap       =   -1  'True
  59.          HideSelection   =   -1  'True
  60.          FullRowSelect   =   -1  'True
  61.          PictureAlignment=   5
  62.          _Version        =   393217
  63.          ForeColor       =   -2147483640
  64.          BackColor       =   -2147483643
  65.          BorderStyle     =   1
  66.          Appearance      =   1
  67.          NumItems        =   0
  68.          Picture         =   "FolderViewListViewDemo.frx":001C
  69.       End
  70.    End
  71.    Begin VB.PictureBox Splitter 
  72.       AutoRedraw      =   -1  'True
  73.       BorderStyle     =   0  'None
  74.       Height          =   7395
  75.       Left            =   3360
  76.       ScaleHeight     =   7395
  77.       ScaleWidth      =   585
  78.       TabIndex        =   0
  79.       Top             =   0
  80.       Width           =   585
  81.    End
  82. Attribute VB_Name = "frmFvLvDemo"
  83. Attribute VB_GlobalNameSpace = False
  84. Attribute VB_Creatable = False
  85. Attribute VB_PredeclaredId = True
  86. Attribute VB_Exposed = False
  87. Option Explicit
  88. '------------------------------------
  89. Private ArqExt       As String
  90. Private WinDir       As String
  91. Private SysDir       As String
  92. Private TempDir      As String
  93. Private SourcePath   As String
  94. Private sFolder      As String
  95. 'Private sFile        As String
  96. Private sName        As String
  97. Private sExtension   As String
  98. Private sSize        As String
  99. Private sType        As String
  100. Private sModified    As String
  101. Private sTime        As String
  102. Private sCreated     As String
  103. Private sAccessed    As String
  104. Private sAttribute   As String
  105. Private sMsDos       As String
  106. Private sNone        As String
  107. Private m_MyDocs     As String
  108. '------------------------------
  109. Private Start        As Long
  110. Private FvFilter     As Variant
  111. Private IsFAT        As Boolean
  112. Private InCab        As Boolean
  113. Private InZip        As Boolean
  114. Private Nodx         As Node
  115. Private TypeNew()    As FTs
  116. '------------------------------
  117. Private WithEvents Archive  As cArchive
  118. Attribute Archive.VB_VarHelpID = -1
  119. '------------------------------
  120. Const MyComputer$ = "MyComputer"
  121. Const Desktop$ = "Desktop"
  122. Private Function NiceCase(ByVal Nam As String) As String
  123.    Dim UNam As String, LNam As String
  124.    On Error GoTo ProcedureError
  125.    UNam = Nam: LNam = Nam
  126.    CharUpper UNam: CharLower LNam
  127.    If Nam = UNam Or Nam = LNam Then
  128.   ' If Nam = UCase$(Nam) Or Nam = LCase$(Nam) Then
  129.       NiceCase = StrConv(Nam, vbProperCase)
  130.    Else
  131.       NiceCase = Nam 'already mixed case so leave alone
  132.    End If
  133. ProcedureExit:
  134.   Exit Function
  135. ProcedureError:
  136.      If ErrMsgBox(Me.Name & ".NiceCase") = vbRetry Then Resume Next
  137. End Function
  138. Private Function BinarySearchTypeNew(sExt As String) As Integer
  139.    Dim iLow As Integer
  140.    Dim iHigh As Integer
  141.    Dim iMid As Integer
  142.    On Error Resume Next
  143.    BinarySearchTypeNew = -1
  144.    iLow = 1 '0 is reserved
  145.    iHigh = UBound(TypeNew) - LBound(TypeNew)
  146.    Do
  147.       iMid = (iLow + iHigh) \ 2
  148.       'always LCase so let's use faster binary compare
  149.       Select Case StrComp(sExt, TypeNew(iMid).Ext, vbBinaryCompare)
  150.          Case -1 '< Less than
  151.             iHigh = iMid - 1
  152.          Case 1  '> Greater than
  153.             iLow = iMid + 1
  154.          Case 0  '= Equal
  155.             BinarySearchTypeNew = iMid
  156.             Exit Do
  157.       End Select
  158.    Loop Until iHigh < iLow
  159. End Function
  160. Private Sub ShellSortTypeNewArray()
  161.   Dim iLowBound As Integer
  162.   Dim iHighBound As Integer
  163.   Dim iX As Integer
  164.   Dim iY As Integer
  165.   Dim Temp As FTs
  166.   On Error GoTo ProcedureError
  167.   ' Get array bounds
  168.   iLowBound = LBound(TypeNew)
  169.   iHighBound = UBound(TypeNew)
  170.   ' Get array middle
  171.   iY = (iHighBound - iLowBound + 1) \ 2
  172.   Do While iY > 0
  173.     ' Sort lower portion
  174.     For iX = iLowBound To iHighBound - iY
  175.       If TypeNew(iX).Ext > TypeNew(iX + iY).Ext Then
  176.         Temp = TypeNew(iX)
  177.         TypeNew(iX) = TypeNew(iX + iY)
  178.         TypeNew(iX + iY) = Temp
  179.       End If
  180.     Next iX
  181.     ' Sort upper portion
  182.     For iX = iHighBound - iY To iLowBound Step -1
  183.       If TypeNew(iX).Ext > TypeNew(iX + iY).Ext Then
  184.         Temp = TypeNew(iX)
  185.         TypeNew(iX) = TypeNew(iX + iY)
  186.         TypeNew(iX + iY) = Temp
  187.       End If
  188.     Next iX
  189.     ' Divide array
  190.     iY = iY \ 2
  191.   Loop
  192. ProcedureExit:
  193.    Exit Sub
  194. ProcedureError:
  195.    If ErrMsgBox(Me.Name & ".ShellSortTypeNewArray") = vbRetry Then Resume Next
  196. End Sub
  197. Private Sub ace_FileFound(ByVal Count As Long, ByVal Filename As String, ByVal DateTime As Date, ByVal Size As Variant, ByVal CompSize As Variant, ByVal Method As Long, ByVal Attr As Variant, ByVal Path As String, ByVal flags As Long, ByVal Crc As Long, ByVal Comments As String)
  198.    With Master
  199.      .GridFormat = gface
  200.      .Index = Count
  201.      .Filename = Filename
  202.      .Size = Size
  203.      .Modified = DateTime
  204.      .Created = DateTime
  205.      .Accessed = DateTime
  206.      .Attr = Attr
  207.      .Path = Path
  208.      .CompSize = CompSize
  209.      .Method = Method
  210.      .flags = flags
  211.      .Encypted = (flags And 1) * -1 'Make it Boolean
  212.      .Crc = Crc
  213.      '.Sig = 0
  214.      .Comments = Comments
  215.    End With
  216.    LVAddCommon Master
  217. End Sub
  218. Private Sub cab_FileFound(ByVal Count As Long, ByVal Filename As String, ByVal MyDate As Date, ByVal Size As Variant, ByVal Attr As Variant, ByVal Path As String)
  219.    With Master
  220.       .GridFormat = gfCab
  221.       .Index = Count
  222.       .Filename = Filename
  223.       .Modified = MyDate
  224.       .Size = Size
  225.       .Attr = Attr
  226.       .Path = Path
  227.    End With
  228.    LVAddCommon Master
  229. End Sub
  230. Private Sub Archive_FileFound(ByVal Index As Long, ByVal Total As Long, ByVal Filename As String, ByVal ArchiveExt As String, ByVal Modified As Date, ByVal Size As Long, ByVal CompSize As Long, ByVal Method As Long, ByVal Attr As Long, ByVal Path As String, ByVal flags As Long, ByVal Crc As Long, ByVal Comments As String)
  231.         '<EhHeader>
  232.         On Error GoTo Archive_FileFound_Err
  233.         '</EhHeader>
  234.     Dim sMethod As String, sExt As String, FakePath As String
  235.     Dim fType As String
  236.     Dim MyIcon As Long
  237.     Dim FakeFile As Integer
  238.     Dim Ratio As Single
  239.     Dim Encrypt As Boolean
  240.     Dim Item As ListItem
  241.        On Error GoTo ProcedureError
  242. 100    If Index = Total Then
  243. 102       ArqExt = ArchiveExt
  244.        End If
  245. 104    sExt = GetExt(Filename)
  246. 106    If LenB(sExt) Then
  247. 108       FakeFile = FreeFile
  248.           'Create fake 0 byte file in TempDir
  249.           'Ex: "C:\Windows\Temp\~FileName.Ext"
  250. 110       FakePath = QualifyPath(TempDir) & "~" & Filename
  251. 112       Open FakePath For Binary As FakeFile
  252. 114       Close FakeFile
  253. 116       fType = GetFileType(sExt, FakePath, MyIcon)
  254. 118       lvi.iImage = MyIcon 'index in System ImageList
  255. 120       Kill FakePath
  256.        End If
  257. 122    Set Item = ListView1.ListItems.Add()
  258. 124    Item.SubItems(LVIdx(nam_)) = Filename
  259. 126    lvi.iItem = Item.Index - 1 ' adjusts to 0-based
  260. 128    lvi.mask = LVIF_IMAGE 'set image mask
  261. 130    SendMessage ListView1.hwnd, LVM_SETITEM, 0&, lvi 'Assign
  262. 132    Item.SubItems(LVIdx(ext_)) = sExt
  263. 134    Item.SubItems(LVIdx(siz_)) = FormatNumber$(Size, 0)
  264. 136    Item.SubItems(LVIdx("siz2")) = Right$(String(10, 48) & Size, 10)
  265. 138    Item.SubItems(LVIdx(typ_)) = fType
  266. 140    Item.SubItems(LVIdx(mod_)) = FormatDateTime(Modified, vbShortDate)
  267. 142    Item.SubItems(LVIdx("mod2")) = Format$(Modified, YMDHMS)
  268. 144    Item.SubItems(LVIdx(tim_)) = FormatDateTime(Modified, vbLongTime)
  269. 146    Item.SubItems(LVIdx("tim2")) = Format$(Modified, HMS)
  270.       
  271.        'If .GridFormat Then 'ace, cab, rar, zip
  272. 148       Item.SubItems(LVIdx(cmp_)) = FormatNumber$(CompSize, 0)
  273. 150       Item.SubItems(LVIdx("cmp2")) = Right$(String(10, 48) & CompSize, 10)
  274.           'Trap division by zero
  275. 152       If Size Then
  276. 154          Ratio = 1 - CompSize / Size
  277.              'Don't allow negative values (per PkZip/WinZip)
  278.              'Occurs on stored+encrypted files
  279. 156          If Ratio < 0 Then Ratio = 0
  280.           Else
  281. 158          Ratio = 0
  282.           End If
  283.           'Ratio is single. Format as desired
  284. 160       Item.SubItems(LVIdx(rat_)) = Format$(Ratio, "00.0%")
  285. 162       Item.SubItems(LVIdx(cre_)) = FormGenDatTim(Modified)
  286. 164       Item.SubItems(LVIdx("cre2")) = Format$(Modified, YMDHMS)
  287. 166       Item.SubItems(LVIdx(acc_)) = FormGenDatTim(Modified)
  288. 168       Item.SubItems(LVIdx("acc2")) = Format$(Modified, YMDHMS)
  289. 170       Select Case ArchiveExt
  290.              Case ace_
  291.                 sMethod = MethodVerboseAce(Method, flags)
  292. 172             Encrypt = (flags And 4) * -1
  293. 174          Case cab_
  294.                 Select Case Method
  295.                    Case 0: sMethod = "None"
  296.                    Case 1: sMethod = "MsZip"
  297.                    Case 2: sMethod = "Lzx"
  298.                 End Select
  299. 182             Encrypt = False
  300. 184          Case rar_
  301.                 sMethod = MethodVerboseRar(Method, flags)
  302.                 'Flag bit 2 is Encryption True/False
  303. 186             Encrypt = (flags And 4) * -1
  304. 188          Case zip_
  305.                 sMethod = MethodVerboseZip(Method, flags)
  306. 190             Encrypt = (flags And 1) * -1
  307.           End Select
  308. 192       Item.SubItems(LVIdx(mtd_)) = sMethod
  309. 194       Item.SubItems(LVIdx(enc_)) = Encrypt
  310. 196       Item.SubItems(LVIdx(crc_)) = Hex$(Crc)
  311.           'Digital Signature extract not yet coded
  312. 198       Item.SubItems(LVIdx(sig_)) = "na"
  313. 200       Item.SubItems(LVIdx(pth_)) = Path
  314. 202       Item.SubItems(LVIdx(com_)) = Comments
  315.       ' End If
  316. 204    Item.SubItems(LVIdx(atr_)) = GetAttrString(Attr)
  317.        'Save the item number for
  318.        'other operations
  319. 206    Item.Tag = Index
  320. '208    ProgressPanel Index, Total
  321.        'TotalSize = TotalSize + .Size
  322. '210    If Index = Total Then Preview.Cls
  323. ProcedureExit:
  324.       Exit Sub
  325. ProcedureError:
  326. 212      If ErrMsgBox(Me.Name & "Archive_FileFound") = vbRetry Then Resume Next
  327.         '<EhFooter>
  328.         Exit Sub
  329. Archive_FileFound_Err:
  330.         Select Case ErrMsgBox("FolderviewDemo.frmFolderviewDemo.Archive_FileFound")
  331.            Case vbAbort
  332.               Screen.MousePointer = vbDefault
  333.               Exit Sub
  334.            Case vbRetry
  335.               Resume
  336.            Case vbIgnore
  337.               Resume Next
  338.        End Select
  339.         '</EhFooter>
  340. End Sub
  341. Private Sub FolderView1_NodeClick(ByVal Node As MSComctlLib.Node)
  342.         '<EhHeader>
  343.         On Error GoTo FolderView1_NodeClick_Err
  344.         '</EhHeader>
  345.        Dim Path As String, sExt As String
  346.        Dim Start As Long
  347. 100    Set Nodx = Node
  348. '102    Tip.Hide
  349. '104    ShowTip = False
  350.        'Reset array of Ext/Type/SysIconIndex
  351.        'Retaining Folder entry if any
  352. 106    ReDim Preserve TypeNew(0)
  353. 108    Select Case Node.Key
  354.           Case "Ftp"
  355. 110          ListView1.ListItems.Clear
  356. 112       Case "Desktop"
  357. 114          LoadFiles QualifyPath(FolderLocation(CSIDL_DESKTOP))
  358. 116       Case "MyComputer"
  359.       
  360. 118       Case "MyDocuments"
  361. 120          LoadFiles QualifyPath(FolderLocation(CSIDL_PERSONAL))
  362. 122       Case "ControlPanel"
  363. 124          Shell "rundll32.exe shell32.dll,Control_RunDLL", vbNormalFocus
  364. 126       Case Else
  365. 128          Path = BuildFullPath(Node)
  366. 130          sExt = GetExt(Node.Text)
  367. 132          Start = GetTickCount()
  368. '134          ShowTip = True
  369. 136          Select Case sExt
  370.                 Case ace_, cab_, rar_, zip_
  371.                    SourcePath = Path
  372. 138                InZip = True
  373. '140                Tip.MouseNotify FolderView1.hWnd, tipMouseMove
  374.                    'LoadStart
  375. 142                Screen.MousePointer = vbHourglass
  376. 144                LVColumnHeaders
  377. 146                Set Archive = New cArchive
  378. 148                Archive.ArchiveName = Path
  379. 150                Archive.ArchiveExt = sExt
  380. 152                Archive.GetInfo
  381. 154                LoadCleanup 1
  382. 156                Me.Caption = Path
  383. 158             Case Else
  384. 160                SourcePath = QualifyPath(Path)
  385. '162                Tip.MouseNotify FolderView1.hWnd, tipMouseMove
  386. 164                LoadFiles (QualifyPath(Path))
  387.              End Select
  388.        End Select
  389.         '<EhFooter>
  390.         Exit Sub
  391. FolderView1_NodeClick_Err:
  392.         Select Case ErrMsgBox("FolderviewDemo.frmFolderviewDemo.FolderView1_NodeClick")
  393.            Case vbAbort
  394.               Screen.MousePointer = vbDefault
  395.               Exit Sub
  396.            Case vbRetry
  397.               Resume
  398.            Case vbIgnore
  399.               Resume Next
  400.        End Select
  401.         '</EhFooter>
  402. End Sub
  403. Private Sub Form_Load()
  404.    ' Copyright 2001 Dana Seaman, Natal, Brazil
  405.    ' E-Mail:  dseaman@ieg.com.br
  406.    Const Shell32$ = "Shell32.Dll"
  407.    FvFilter = Split(LCase(FolderView1.FileFilter), ";")
  408.    m_MyDocs = FolderLocation(CSIDL_PERSONAL)
  409.    'If Not AssignSysIL Then MsgBox "Error in AssignSysIl"
  410. '------------------------------
  411.    'Get Win, Sys, & Temp directory paths
  412.    WinDir = Left$(Buffer, GetWindowsDirectory(Buffer, MAX_PATH))
  413.    SysDir = Left$(Buffer, GetSystemDirectory(Buffer, MAX_PATH))
  414.    TempDir = Left$(Buffer, GetTempPath(MAX_PATH, Buffer))
  415. '---- Rip resource strings from Windows Dll's ----
  416.    sFolder = GetResourceStringFromFile(Shell32, 4131) '"(" & GetResourceStringFromFile(Shell32, 4131) & ")"
  417.    'sFile = GetResourceStringFromFile(Shell32, 4130)
  418.    sName = GetResourceStringFromFile(Shell32, 8976)
  419.    sExtension = StrConv(ext_, vbProperCase)
  420.    sSize = GetResourceStringFromFile(Shell32, 8978)
  421.    sType = GetResourceStringFromFile(Shell32, 8979)
  422.    sModified = GetResourceStringFromFile(Shell32, 8980)
  423.    sTime = GetResourceStringFromFile("Intl.Cpl", 25)
  424.    sCreated = GetResourceStringFromFile(Shell32, 8996)
  425.    sAccessed = GetResourceStringFromFile(Shell32, 8997)
  426.    sAttribute = GetResourceStringFromFile(Shell32, 8987)
  427.    sMsDos = "MsDos 8.3"
  428.    sNone = GetResourceStringFromFile(Shell32, 9808)
  429. '-------------------------------
  430.    FolderView1.Enumerate
  431.    LVColumnHeaders
  432.    ListView1.Visible = True
  433.    ListView1.Refresh
  434.    ReDim Preserve TypeNew(0) 'init array of Ext/Type/IconIdx
  435.    'FolderView1.Path = "C:\_AceRarSamples"
  436.    'LoadFiles (FolderView1.Path)
  437. End Sub
  438. Sub LoadFiles(ByVal Path As String)
  439.        
  440.    On Error GoTo ProcedureError
  441.    Dim Win32Fd As WIN32_FIND_DATA
  442.    Dim lHandle As Long
  443.    Dim Item As ListItem
  444.    Dim MyName As String
  445.    Dim sExt As String
  446.    Dim MyDate As Date
  447.    Dim MySize As Currency
  448.    Dim MyIcon As Long
  449.    Dim Start As Long
  450.    Dim MyCount As Long
  451.    Const MustGet$ = "exe|ico|lnk|pif|cur"
  452.    Start = GetTickCount()
  453.    Screen.MousePointer = vbHourglass
  454.    InZip = False
  455.    SourcePath = QualifyPath(Path)
  456.    LVColumnHeaders
  457.    IsFAT = CheckFAT
  458.    lHandle = FindFirstFile(SourcePath & "*.*", Win32Fd)
  459.    If lHandle > 0 Then
  460.       Do
  461.          If Asc(Win32Fd.cFileName) <> 46 Then  'skip . and .. entries
  462.             MyName = StripNull(Win32Fd.cFileName)
  463.             Set Item = ListView1.ListItems.Add()
  464.             Item.SubItems(LVIdx(nam_)) = NiceCase(MyName)
  465.             sExt = GetExt(MyName)
  466.             Item.SubItems(LVIdx(ext_)) = sExt
  467.             If Win32Fd.dwFileAttributes And vbDirectory Then
  468.                Item.SubItems(LVIdx(typ_)) = sFolder 'from Registry
  469.                If TypeNew(0).Type <> sFolder Then
  470.                   'Get/Store Folder Icon (Only once)
  471.                   SHGetFileInfo Path & MyName, 0&, SFI, cbSFI, SMALLSYS_SHGFI_FLAGS
  472.                   TypeNew(0).Type = sFolder
  473.                   TypeNew(0).IconIndex = SFI.iIcon
  474.                End If
  475.                lvi.iImage = TypeNew(0).IconIndex
  476.             Else
  477.                MySize = CVC(Win32Fd.nFileSizeBig) * 10000
  478.                Item.SubItems(LVIdx(siz_)) = FormatSize(MySize)
  479.                Item.SubItems(LVIdx("siz2")) = Right(String(10, 48) & MySize, 10)
  480.                Item.SubItems(LVIdx(typ_)) = GetFileType(sExt, Path & MyName, MyIcon)
  481.                If Len(sExt) = 3 And InStr(MustGet, sExt) Then
  482.                   'Always obtain Icons for exe,ico,lnk,pif,cur
  483.                   SHGetFileInfo Path & MyName, 0&, SFI, cbSFI, SMALLSYS_SHGFI_FLAGS
  484.                   lvi.iImage = SFI.iIcon
  485.                Else 'Use associated Icon
  486.                   lvi.iImage = MyIcon 'index in system imagelist
  487.                End If
  488.             End If
  489.             lvi.iItem = Item.Index - 1 'item index (-1 adjusts to 0-based api index)
  490.             lvi.mask = LVIF_IMAGE 'just setting image index
  491.             'assign item's image index via api...
  492.             SendMessage ListView1.hwnd, LVM_SETITEM, 0&, lvi
  493.             
  494.             MyDate = UTCCurrToVbDate(Win32Fd.ftLastWriteTime)
  495.             Item.SubItems(LVIdx(mod_)) = FormatDateTime(MyDate, vbShortDate)
  496.             Item.SubItems(LVIdx("mod2")) = Format(MyDate, YMDHMS)
  497.             Item.SubItems(LVIdx(tim_)) = FormatDateTime(MyDate, vbLongTime)
  498.             Item.SubItems(LVIdx("tim2")) = Format(MyDate, HMS)
  499.             MyDate = UTCCurrToVbDate(Win32Fd.ftCreationTime)
  500.             'Don't use VbGeneralDate since it ignores 00:00:00
  501.             Item.SubItems(LVIdx(cre_)) = FormGenDatTim(MyDate)
  502.             Item.SubItems(LVIdx("cre2")) = Format(MyDate, YMDHMS)
  503.             MyDate = UTCCurrToVbDate(Win32Fd.ftLastAccessTime)
  504.             If IsFAT Then ' FAT (Just date)
  505.                Item.SubItems(LVIdx(acc_)) = FormatDateTime(MyDate, vbShortDate)
  506.             Else 'NTFS (Date + Time)
  507.                Item.SubItems(LVIdx(acc_)) = FormGenDatTim(MyDate)
  508.             End If
  509.             Item.SubItems(LVIdx("acc2")) = Format(MyDate, YMDHMS)
  510.             Item.SubItems(LVIdx(atr_)) = GetAttrString(Win32Fd.dwFileAttributes)
  511.             'Get Filename MsDos 8.3
  512.             If InStr(Win32Fd.cAlternate, vbNullChar) = 1 Then
  513.                CharUpper MyName
  514.                Item.SubItems(LVIdx(dos_)) = MyName
  515.             Else
  516.                Item.SubItems(LVIdx(dos_)) = StripNull(Win32Fd.cAlternate)
  517.             End If
  518.          End If
  519.          MyCount = MyCount + 1
  520.          If MyCount Mod 50 = 0 Then
  521.             ShowProgress Start, MyCount, Path
  522.          End If
  523.       Loop While FindNextFile(lHandle, Win32Fd) > 0
  524.    End If
  525.    FindClose lHandle
  526. '------------
  527.    LoadCleanup 3
  528.    ShowProgress Start, MyCount, Path
  529. ProcedureExit:
  530.    Exit Sub
  531. ProcedureError:
  532.    If ErrMsgBox(Me.Name & ".LoadFiles") = vbRetry Then Resume Next
  533. End Sub
  534. Private Sub ShowProgress(Start, Count, Path)
  535.    Me.Caption = Format((GetTickCount() - Start) / 1000, "#,##0.00") & " seconds, " & _
  536.                 Count & " Objects in " & Path
  537. End Sub
  538. Private Function GetFileType(ByVal sExt As String, ByVal FullPath As String, ByRef MyIcon As Long) As String
  539.    On Error GoTo ProcedureError
  540.    Dim sName As String
  541.    Dim lRegKey As Long, L4 As Long
  542.    If sExt <> "" Then
  543.       'NOTE: Array must be sorted for binary search
  544.       L4 = BinarySearchTypeNew(sExt)
  545.       If L4 <> -1 Then
  546.          GetFileType = TypeNew(L4).Type
  547.          MyIcon = TypeNew(L4).IconIndex
  548.          Exit Function
  549.       End If
  550.       'Not a duplicate so get info from registry
  551.       If RegOpenKey(HKEY_CLASSES_ROOT, ByVal "." & sExt, lRegKey) = 0 Then
  552.          'Get type of file (Not to be confused with actual FileType )
  553.          RegQueryValueEx lRegKey, ByVal "", 0&, 1, ByVal Buffer, MAX_PATH
  554.          sName = StripNull(Buffer)
  555.          RegCloseKey lRegKey
  556.          If Len(sName) Then
  557.             'Get FileType
  558.             If RegOpenKey(HKEY_CLASSES_ROOT, sName, lRegKey) = 0 Then
  559.                RegQueryValueEx lRegKey, ByVal "", 0&, 1, ByVal f_Type, 80
  560.                GetFileType = StripNull(f_Type)
  561.                RegCloseKey lRegKey
  562.             End If
  563.          End If
  564.       End If
  565.       'Bump array and add new extension/type
  566.       L4 = UBound(TypeNew()) + 1
  567.       ReDim Preserve TypeNew(L4)
  568.       TypeNew(L4).Ext = sExt
  569.       If GetFileType = "" Then 'No associated type
  570.          GetFileType = sNone 'was sFile & " " & UCase$(sExt)
  571.          TypeNew(L4).IconIndex = 0
  572.       Else 'New Ext, get this Icon
  573.          SHGetFileInfo FullPath, 0&, SFI, cbSFI, SMALLSYS_SHGFI_FLAGS
  574.          TypeNew(L4).IconIndex = SFI.iIcon  'index in system imagelist
  575.       End If
  576.       TypeNew(L4).Type = GetFileType
  577.       MyIcon = TypeNew(L4).IconIndex
  578.       ShellSortTypeNewArray 'So we can use a binary search
  579.    End If
  580. ProcedureExit:
  581.   Exit Function
  582. ProcedureError:
  583.      If ErrMsgBox(Me.Name & ".GetFileType") = vbRetry Then Resume Next
  584. End Function
  585. Private Function GetExt(ByVal Name As String) As String
  586.    On Error GoTo ProcedureError
  587.    Dim j As Integer
  588.    j = InStrRev(Name, ".")
  589.    If j > 0 And j < (Len(Name)) Then
  590.       GetExt = Mid$(Name, j + 1)
  591.       CharLower GetExt
  592.    End If
  593. ProcedureExit:
  594.   Exit Function
  595. ProcedureError:
  596.      If ErrMsgBox(Me.Name & ".GetExt") = vbRetry Then Resume Next
  597. End Function
  598. Private Function MethodVerboseZip(ByVal Method, ByVal BitFlag) As String
  599.    On Error Resume Next
  600.    'Conforms to PkZip 2.04g Specifications
  601. 'Methods are
  602. '0    Stored (None)
  603. '1    Shrunk
  604. '2-5  Reduced:1,2,3,4
  605. '(For Method 6 - Imploding)
  606. ' general purpose bit flag: (2 bytes)
  607. 'Bit 1: If the compress_ng)
  608. ' general purpose bit flagType") em.SubItems(LVIdx(r  .Size = Size
  609.       As(LVISLtfleFilDw"tMcessTime)
  610. x(r  .Size = Size
  611. ime Next
  612. End Fo 0&, 1, ByVal f_Type, 80
  613.       PCn7it0ga      GetExt = Mid$(Name, j + 1)
  614.       CharLower GetExt
  615.    ExontrolPanel"
  616. 124 h Regcrp
  617.  'me As S GetFi As S GetFi As S GVal BitFlag)
  618.    If lHandn GetFi As S GetFi AsolPanel" nv- ImpIFi As S GetFi As     h.,goDA7y8
  619.