Kilho.net

Etiqueta: Delphi

IT

Uso de hilos en Delphi

Una forma sencilla de usar hilos en Delphi. Basta con usar synchronize correctamente 🙂 Contenido de la función [code lang=»delphi»] uses System.Classes, System.SysUtils, Vcl.Forms; procedure Wait(Proc: TProc); var Thread: TThread; begin Thread := TThread.CreateAnonymousThread(procedure() begin Proc; end); Thread.FreeOnTerminate := True;…

Leer más — Uso de hilos en Delphi
IT

Monitoreo del registro (Delphi)

Instrucciones de uso procedure RegistryMonitor(RootKey: HKEY; Key: string; Proc: TProc; WatchSub: boolean); begin TThread.CreateAnonymousThread(procedure var Reg: TRegistry; Event: cardinal; begin Reg := TRegistry.Create; Reg.RootKey := RootKey; if Reg.OpenKeyReadOnly(Key) then begin Event := CreateEvent(nil, False, False, nil); if Event > 0…

Leer más — Monitoreo del registro (Delphi)