Using threads in Delphi
It's easy to use threads in Delphi. Synchronize can be used well :-) Function How to use
It's easy to use threads in Delphi. Synchronize can be used well :-) Function How to use
How to use Procedure RegistryMonitor (Rootkey: hKey; Key: String; Proc: Tproc; WatchSub: boolean); begin TTHREAD.CREATEANYNYMOUSTHREAD (Procedure var Reg: Tregistry; Event: Cardinal; begin Reg: = trrewistry.create; Reg.rootkey: = rootKey; if reg.openkeyreadonly (key) begin Event: = Createevent (NIL, FALSE, FALSE, NIL); if event> 0 then begin while true do begin RegNotifychandureKeyvalue (reg.currentkey, watchsub, reg_notify_Change_last_set, event, true); if waitForsingleObject (event, infinite) = wait_object_0 the tthread.synchronize (TTHREAD.CURENTHREAD, Procedure Begin Proc End); End; End; End; Reg.Free; end) .start; End; // Proc: Enter command // WatchSub: Subside monitoring ...