I could not find where FileSpec was defined in your program. Using addr should be correct for StartFolder. If FileSpec is defined in a data section, then addr should work.
If FileSpec contains the the address of a string, then don't use addr. Like I say, I couldn't find it in your program, so I don't know which is correct in your case.
I don't have your version of bmbuttons.inc, so I couldn't really test your program otherwise, there were dozens of errors using my version.
Also, here's the latest version of GetNextFile. It uses the heap for storage rather than putting a lot of stuff in your .data section, and has some other small changes.
Attached File ( Number of downloads: 5 )