[Lazarus] Lazarus and Application.ProcessMessages

Michael Schnell mschnell at lumino.de
Fri Dec 5 14:53:38 CET 2014

On 12/04/2014 04:24 PM, Lukasz Sokol wrote:
> Or e.g. I run FindFirst/FindNext loop over a large number of files, or 
> even if I delegate reading of a file to another procedure, still takes 
> time while nothing else can happen... (although /that/ actually I can 
> imagine doing in a thread). Then such Application.ProcessMessages is 
> about the only option ?

A long winding loop (such as "FindNext" freezes the GUI and all TTimers 
if you don't include ProcessMessages.

If doing the loop in a Thread you can send status messages to the main 
(GUI) thread by means of TThread.Queue or Application.QueueAsyncCall. 
(You do know that you can't access the GUI from a worker thread.)


More information about the Lazarus mailing list