nickwa
April 29th, 2001, 09:43 PM
Hi, I can use the win32APi FindFirstFile ok, but want to be able to get it to look for files recursively, ie include all subdirectries within current path. ie c:\te*.txt ie find the first file that meets this criteria wherever it is on c: drive. It seems to only search in the root directory in the example above. Is there any way to make it search all subdirectories, or is there another API that will do this? thanks very much! ps I can do it with the DIR$ and an array, but I want to use an API.
private Sub Command1_Click()
Dim sFileName as string
Dim FindFileData as WIN32_FIND_DATA
Dim FindFileDataReturn as Long
FindFileDataReturn = FindFirstFile("c:\te*.txt", FindFileData)
Text1.Text = FindFileDataReturn
Text2.Text = FindFileData.cFileName
End Sub
I have declared the api etc in a module.
private Sub Command1_Click()
Dim sFileName as string
Dim FindFileData as WIN32_FIND_DATA
Dim FindFileDataReturn as Long
FindFileDataReturn = FindFirstFile("c:\te*.txt", FindFileData)
Text1.Text = FindFileDataReturn
Text2.Text = FindFileData.cFileName
End Sub
I have declared the api etc in a module.