Delphiran - Delphi Tips
Question :
How can I have a synchronize method with parameters in a Thread ?

Answer :
Make the parameters fields of the thread object:

 type
   TMyThread = class(TThread)
     private
       FDC: THandle;
       FRect: TRect;
     protected
       procedure Update;
       ...
     end;

 procedure Update;
   begin
   InvalidateRect(FDC, FRect, False) end;

 ...

 procedure TMyThread.Execute;
   begin
   ...
   FDC := SomeDC;
   FRect := SomeRect;
   Synchronize(Update);
   ...
   end;
 
 

 
 
© All rights reserved 1999 BuyPin Software