You create a recursive scenario yourself by calling Application.ProcessMessages inside of ShowError inside of HandleError - which is the message handling procedure itself, which is triggered by Application.ProcessMessages.