Results 1 to 2 of 2

Thread: multiple files to listbox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2003
    Location
    Wigan, UK
    Posts
    291

    multiple files to listbox

    how would i go about retrieving all the files (filenames) in a specified folder to a listbox.

    thanks
    thingimijig.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Declare Function SendMessage Lib "User" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
    2. Private Const WM_USER = &H400
    3. Private Const LB_DIR = (WM_USER + 14)
    4. Private Const DIR_NORMALFILES = &H0
    5.  
    6. Sub ListFiles (sFileSpec As String)
    7. Dim i As Long
    8. List1.Clear
    9. i = SendMessage(List1.hWnd, LB_DIR, DIR_NORMALFILES, ByVal sFileSpec)
    10. End Sub
    11.  
    12. Private Sub Command1_Click ()
    13. Call ListFiles("C:\WINDOWS\*.*")
    14. End Sub
    -= a peet post =-

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