News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

speed up findfirst/ findnext

Started by elmo, April 12, 2011, 03:50:20 AM

Previous topic - Next topic

elmo

I usually list a file from a spesific directory (Example: C:\) with API FindFirstFile & FindNextFile in a looping.

But, this API will works slowly if I want to list a file from a directory (Example: C:\folder1\ who has > 1000 files in it).
As the result, the user will wait for a seconds until API FindNextFile arrive at the end of the file from that directory.
And this waiting time will annoyed for the impatient user. :lol

how to solve this?
would you like to share me a clue?
thank you.
best regards,
be the king of accounting programmer world!

hutch--

Elmo,

One trick is to turn off the list of listview dispay while you are loading it. Reduces the time to scan the whole directory. You are basically limited to disk IO speed in a task like this so there may not be any really fast alternatives to what you are doing.


  ; before the scan

    fn  LoadCursor,NULL,IDC_WAIT
    fn SetCursor,eax

    fn SendMessage,hlview,WM_SETREDRAW,FALSE,0



  ; after the scan
    fn SendMessage,hlview,WM_SETREDRAW,TRUE,0

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php