Aus diesem Grund macht TThread.WaitFor etwas, was man sonst besser nicht macht .. quasi ein Application.ProcessMessages;
Delphi-Quellcode:
{ This prevents a potential deadlock if the background thread
does a SendMessage to the foreground thread }
if WaitResult = WAIT_OBJECT_0 + 2 then
PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE);