hossa

i try to use the findfirst findnext function and aehm im unable to get it working :(
i try to convert a masm sample to tasm.

hm normal i mean it must be very easy....call findfirst..offset wheretofind (c:\test\*.*)
the result should be the first file
but my result is allways empty ?!?

then ,for the loop do i have to count the files first in the directory or is there a error or something i can look for when there is no more files to search for ?

i only need to look in 1 directory ,lets say Autostart folder.

thanks
Posted on 2001-12-19 05:01:13 by Max
check Iczelions tut 31 this deals with FindFirstFile, FindNextFile
Posted on 2001-12-19 06:11:02 by Allanon
call findfirst..offset wheretofind (c:\test\*.*)
the result should be the first file

The result comes in two parts for this call: the handle to the first file, and the data contained in your WIN32_FIND_DATA struct. The handle is used in your call to FindNextFile, the API uses that handle to keep track of where it is up to in the directory. Which file you get back first will depend on the OS and filesystem: if you are on NTFS, the "." and ".." directories are returned first, followed by the rest of the files/folders in alphabetic order. If you are on FAT32/FAT16, the files/folders are returned in random order, unless you are running Win2K which follows the rule for NTFS even when you are running FAT32.

but my result is allways empty ?!?

What is always empty? Do you mean your handle is NULL, or your struct is not being filled?

then ,for the loop do i have to count the files first in the directory or is there a error or something i can look for when there is no more files to search for ?

When the handle comes back NULL from a call to FindNextFile, that means there is no more files to enumerate in that folder.
Posted on 2001-12-19 06:18:08 by sluggy
Yeah cool !

Now i understand !!!
ha i try to show the first result i get back as filename *bg*
thats my misstake aaaaaaah light goes on :)

thanks !
Posted on 2001-12-19 06:27:12 by Max