Results 1 to 2 of 2

Thread: path looking through files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    Red face

    i want to be able to click my command button and the windows exploring start menu comes up then takes me to a set path of eg c:/windows/datafile/
    where i can see all the files in that path
    how do you do that,an API maybe??????



  2. #2
    Guest
    Do you mean, open a folder?

    Code:
    Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
    lpOperation As String, ByVal lpFile As String, ByVal _
    lpParameters As String, ByVal lpDirectory As String, ByVal _
    nShowCmd As Long) As Long
    Public Const SW_SHOWNORMAL = 1
    
    ShellExecute Me.hwnd, vbNullString, "C:\Windows", vbNullString, "c:\", SW_SHOWNORMAL
    Or do you want to list the files in a listbox?

    Code:
    Private Sub Command1_Click()
        Dim FileFinder
        List1.Clear
        FileFinder = Dir("C:\Windows\")
        Do Until FileFinder = ""
        List1.AddItem LCase(FileFinder)
        FileFinder = Dir
        Loop
    End Sub

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