Tech Story - Page 1005 of 1031 - Technology & Software Download

Show Directories in a TTreeview

Show Directories in a TTreeview procedure TForm1.GetDirectories(Tree: TTreeView; Directory: string; Item: TTreeNode; IncludeFiles: Boolean); var SearchRec: TSearchRec; ItemTemp: TTreeNode; begin Tree.Items.BeginUpdate; if Directory '\' then Directory := Directory + …

Replace a running DLL

Replace a running DLL function SystemErrorMessage: string; var P: PChar; begin if FormatMessage(Format_Message_Allocate_Buffer + Format_Message_From_System, nil, GetLastError, 0, @P, 0, nil) 0 then begin Result := P; LocalFree(Integer(P)) end …

Get the Path to Program files

Get the Path to Program files uses Registry; function GetProgramFilesDir: string; var reg: TRegistry; begin reg := TRegistry.Create; try reg.RootKey := HKEY_LOCAL_MACHINE; reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False); Result := reg.ReadString('ProgramFilesDir'); finally reg.Free; …

Use TFileStream

Use TFileStream type TPerson = record Name: string; vorname: string; end; TComputer = record Name: string; cpu: string; end; var Form1: TForm1; Person: TPerson; Computer: TComputer; Stream: TFileStream; implementation …