I switched to using a component for searching for the files, I still have the same problem. This is the FormShow event of the form that is supposed to update the progress status displays. Like I said, works fine with Delphi 3 Standard.
procedure TProgressForm.FormShow(Sender: TObject);
var ext: string;
c : integer;
begin
SearchResult := TStringList.Create;
SearchResult.Clear;
Screen.Cursor := crHourglass;
MainForm.StatusWindow.Clear;
MainForm.ClientHeight := 525; { show status window }
ProgressForm.StopButton.Caption := 'Stop';
CancelProcess := False;
AbortProcess := False;
TotalFilesFound := 0;
Application.ProcessMessages;
ProgressForm.TotalProgressBar.Position := 0;
ProgressForm.ProcessingFilesMemo.Clear;
SetFocus;
ProgressForm.EasyFileSearch1.FileNames.Clear;
ProgressForm.EasyFileSearch1.RootPath := MainForm.SelectedDirectoryCombobox.Text;
{ Initialize search criteria }
with ProgressForm.EasyFileSearch1 do
begin
SearchOptions := [];
if MainForm.SearchSubdirsCheckBox.Checked=True then SearchOptions := SearchOptions + [okIncludeSubfolder ];
SearchOptions := SearchOptions + [okLookForReadOnlyFile];
SearchOptions := SearchOptions + [okLookForArchiveFile ];
SearchOptions := SearchOptions + [okLookForAnyFile ];
end;
ext := MainForm.FilterExtensionsComboBox.Text;
Repeat
//SetLength(Result, Length(Result)+ 1);
C:= Pos(';', ext);
If C = 0 Then C := Length(ext) + 1;
//Result[Length(Result)- 1]:= Copy(S, 1, C- 1);
//vidal code: mFileScan1.Filters.Add(Copy(ext, 1, C- 1));
ProgressForm.EasyFileSearch1.FileNames.Add(Copy(ext, 1, C- 1));
Delete(ext, 1, C);
Until Length(ext) = 0;
if MainForm.GreedyCheckBox.Checked then
RegExprModifierG := True
else
RegExprModifierG := False;
if MainForm.ModifierSlashMCheckBox.Checked then
RegExprModifierM := True
else
RegExprModifierM := False;
if MainForm.ModifierSlashSCheckBox.Checked then
RegExprModifierS := True
else
RegExprModifierS := False;
if MainForm.ModifierSlashXCheckBox.Checked then
RegExprModifierX := True
else
RegExprModifierX := False;
StartTime := now;
MainForm.StatusWindow.Lines.Add('>> Starting process: ' + DateTimeToStr(StartTime));
ProgressForm.ProcessingFilesMemo.Lines.Add('>> Starting process: ' + DateTimeToStr(StartTime));
MainForm.StatusWindow.Lines.Add('>> Scanning directory(ies) for files...');
ProgressForm.ProcessingFilesMemo.Lines.Add('>> Scanning directory(ies) for files...');
Application.ProcessMessages;
if ProgressForm.EasyFileSearch1.Search=False then
begin
//Application.ProcessMessages;
MessageBox(Handle, 'Error during the search operation !', 'ERROR', 0);
end
else
begin
Application.ProcessMessages;
ProcessFoundFiles;
end;
end;