There should be no GUI access from within threads - in your case EncryptProc is writing to the text control directly - you need to either:
- Use CallAfter in the thread to update the text control after the thread exits or
- Raise custom event an event in the thread that carries the file name information and have a hander in the main thread that updates the text control on receiving the event.