TFindFile

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TFindFile

Postby salim » March 10th, 2008, 6:43 pm

Hi used your greate component TFindFile in my project .
i'm wondering if it's possible to add the Suspend and Resume feature to its Thread it will be very greate .


Regards Salim.
salim
Active Member
Active Member
 
Posts: 6
Joined: March 10th, 2008, 6:36 pm

Postby Kambiz » March 16th, 2008, 2:18 am

I'll do it in the next update.

Thank you
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby salim » March 21st, 2008, 4:54 pm

Does the next update take a long time , or maybe 10 or 15 Days :roll:

cause i really need this update .


regards

Salim
salim
Active Member
Active Member
 
Posts: 6
Joined: March 10th, 2008, 6:36 pm

Postby Kambiz » March 22nd, 2008, 2:52 pm

It would take a long long time. :oops:
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby salim » June 8th, 2008, 6:01 am

Hi Kambiz could you please do it , cause i really need it as soon as possible .

regards
salim
Active Member
Active Member
 
Posts: 6
Joined: March 10th, 2008, 6:36 pm

Postby Kambiz » June 8th, 2008, 6:43 pm

You can use a TEvent object in your code to implement Suspend and Resume.

Code: Select all
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FindFile,
  SyncObjs;                                    // don't miss this unit

type
  TForm1 = class(TForm)
    FindFile: TFindFile;
    btnSuspend: TButton;
    btnReume: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FindFileFolderChange(Sender: TObject; const Folder: String;
      var IgnoreFolder: TFolderIgnore);
    procedure FindFileFileMatch(Sender: TObject; const Folder: String;
      const FileInfo: TSearchRec);
    procedure btnSuspendClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure btnReumeClick(Sender: TObject);
  private
    { Private declarations }
    Event: TEvent;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Event := TEvent.Create(nil, True, True, '');
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Event.Free;
end;

procedure TForm1.FindFileFolderChange(Sender: TObject;
  const Folder: String; var IgnoreFolder: TFolderIgnore);
begin
  Event.WaitFor(INFINITE);
  // your code
end;

procedure TForm1.FindFileFileMatch(Sender: TObject; const Folder: String;
  const FileInfo: TSearchRec);
begin
  Event.WaitFor(INFINITE);
  // your code
end;

procedure TForm1.btnSuspendClick(Sender: TObject);
begin
  Event.ResetEvent;
end;

procedure TForm1.btnReumeClick(Sender: TObject);
begin
  Event.SetEvent;
end;

end.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 3 guests

cron