Delphi

Using Threads in Delphi

This is an easy way to work with threads in Delphi. Just make sure to use synchronize properly 🙂 Function Details uses System.Classes, System.SysUtils, Vcl.Forms; procedure Wait(Proc: TProc); begin Thread := TThread.CreateAnonymousThread(procedure() begin Proc; end); Thread.FreeOnTerminate := True; Thread.Start; while not Thread.Finished do Application.ProcessMessages; end; How to Use Wait(procedure() begin // .... content end);

Registry Monitoring (Delphi)

How to Use 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 then begin while True do begin RegNotifyChangeKeyValue(Reg.CurrentKey, WatchSub, REG_NOTIFY_CHANGE_LAST_SET, Event, True); if WaitForSingleObject(Event, INFINITE) =...

Installing and Using Delphi 10.2 Tokyo Linux PAServer

Delphi has been updated to version 10.2. This is the first installation method for use on CentOS 7. # yum -y update # yum install -y firewalld # systemctl unmask firewalld # systemctl enable firewalld # systemctl start firewalld # firewall-cmd --permanent --add-port=64211/tcp # firewall-cmd --reload # yum group install "Development Tools" # yum install...