I've uploaded some code here (3K) that searches for files in the C drive (root only, no subdirs). During the search, a label's caption is changed. Once the thread has finished, some labels are changed in the OnTerminate proc for the thread. You can also change the caption there without it blowing up on you, hopefully.

I used FreeOnTerminate = True for the threads. I can't get the thing to crash at the mo, so I'm assuming it's pretty solid. Perhaps the problem you had was related to something else (freeing it inside the OnTerminate? Not checking for Terminated in your thread's Execute often enough?).

Some notes for the code:

It only does the main c: drive. If you want subdirs, I'd recommend pushing the full subdir paths onto a stack (a TStringList) instead of using recursion, which will make it easier for the thread to terminate nicely. Keep on looping through each dir for every file. At the end of each dir, pop a path from the stack. Continue until the stack is empty.

There's a MessageBox commented out - uncomment if you want to know the thread is dying.

It's only been tested under Windows ME. I've not yet tried 2K, but I'm assuming it will be okay there.

Of course, it goes much quicker when you *don't* change a label during the search.

I'm explicitly killing the thread if required in the containing class' destructor. This safely covers closing the app during a search. I'm not sure what would happen if you relied on FreeOnTerminate - something to investigate.

The usual "caveat emptor", etc., disclaimers apply.