Zitat von
alzaimar:
Why don't you send a message to the main form which then terminates your thread, waits for it and finally restarts the application?
Yes I thought of that, but I'm not sure how to send a message to my Main application once the thread as terminated.
As i said, the Main application must terminate, depending on the outcome of the thread. So the thread should first finish before the outcome is known, and only then can the Main application be terminated.