Can any one please tell me or give me an algo. to find *.files on and entire harddisk and show the results to the
user

Thankx In Advance...
Posted on 2003-09-15 07:04:19 by telophase
Hello telophase,


The following proc is pretty standard for use in recursively finding files.
just define file as *.*
and szPattern as %s%s
and szPattern\ as %s%s\
start in the root directory: d:\ for example

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FindFileDir proc File:DWORD,Path:DWORD

LOCAL wfd:WIN32_FIND_DATA
LOCAL Buffer
LOCAL hFile:DWORD

invoke wsprintf,addr Buffer,offset szPattern,Path,File
invoke FindFirstFile,addr Buffer,addr wfd

.if eax ==INVALID_HANDLE_VALUE
jmp @f
.endif

mov hFile, eax
jmp @dir

@next:
invoke FindNextFile,hFile,addr wfd
or eax,00h
jnz @dir
invoke FindClose,hFile
xor eax,eax
ret

@dir:
mov al,byte ptr
cmp al,2eh
jz @next
invoke wsprintf,addr Buffer,offset szPattern\,\
Path,addr wfd.cFileName


;out put your data here to a list view or write file etc.

invoke FindFileDir,File,addr Buffer
jmp @next
@@:

ret

FindFileDir endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


hope this is helpful,

best regards,

czDrillard
Posted on 2003-09-15 09:00:53 by czDrillard