TTask doesn't have an event when it stops running. Your task procedure needs to use TThread.Synchronize() or TThread.Queue() (or any other inter-thread mechanism of your choosing) to notify the main thread before it exits. Otherwise, use TThread instead of TTask. TThread has an OnTerminate event.