Results 1 to 2 of 2

Thread: Picture Search

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Location
    Staffodshire, England
    Posts
    32

    Wink

    Is it possible to search the hard drive for picture files, and list the results in a list box.

    Thanks

    Mark_Dep
    :P

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm just modifying my code, i had in an usercontrol for your purpose, i haven't tested it yet, try it:
    Code:
    Public filemax
    Public diremax
    Public tid
    Sub explore(startdir As String, Optional pauses = 100)
        filemax = 0: diremax = 0: Totalb = 0: curlevel = 0
        If Right(startdir, 1) <> "\" Then startdir = startdir & "\"
        ListSubDirs startdir, pauses
    
        tid = Timer - tids
    End Sub
    
    Sub ListSubDirs(path As String, pauses)
    Dim i, dmax, dirname As String, dire() As String
        dirname = Dir(path, 63)
        Do While dirname <> ""
            If dirname <> "." And dirname <> ".." Then
                If Int(GetAttr(path + dirname) / 16) Mod 2 = 1 Then
                        
                        If (dmax Mod 10) = 0 Then
                            ReDim Preserve dire(dmax + 10)
                        End If
                    diremax = diremax + 1: dmax = dmax + 1
                    dire(dmax) = dirname
                Else
                    filemax = filemax + 1
                    If path Like "*.jpg" Or dirname Like "*.gif" Or dirname Like "*.bmp" Then list1.AddItem path & direname
                End If
            End If
                dirname = Dir
            waiter = waiter + 1: If waiter Mod (pauses) = 1 Then DoEvents
        Loop
        For i = 1 To dmax
            ListSubDirs path & dire(i) & "\", pauses
        Next i
    End Sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width