https://stackoverflow.com/questions/46756615/not-responding-in-delphi-avoid-processmessages-and-use-threads