How to exclude folder and subfolder in Tfilefind

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

How to exclude folder and subfolder in Tfilefind

Postby mycwcgr » November 8th, 2003, 8:09 am

I use Tfilefind VCL,could you tell me how to exculde some files in a folder and its subfolder?

Sample:
I want to exclude ALL directories and files below the 'My Pictures' one, not just files inside of 'My Pictures'.
After I set filefind1.Excluded.add('c:\My Pictures\*.*'), the files in 'c:\My Pictures\cw\' and 'c:\My Pictures\cgr\' will not be excluded
mycwcgr
Member
Member
 
Posts: 2
Joined: November 8th, 2003, 7:58 am

Postby Kambiz » November 8th, 2003, 12:34 pm

Instead of the Excluded property you should use the OnFolderChange event. The Excluded property is for filtring files, not folders.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Could you give me a sample about how to use OnFolderChange

Postby mycwcgr » November 9th, 2003, 12:42 am

Could you give me a sample about how to use OnFolderChange event to exclude folder?
mycwcgr
Member
Member
 
Posts: 2
Joined: November 8th, 2003, 7:58 am

Postby Kambiz » November 9th, 2003, 11:23 am

Code: Select all
procedure TForm1.FindFile1FolderChange(Sender: TObject;
  const Folder: String; var IgnoreFolder: TFolderIgnore);
begin
  if Pos('c:\my pictures\', LowerCase(Folder)) = 1 then
    IgnoreFolder := True;
end;
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 1 guest

cron