DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to exclude folder and subfolder in Tfilefind

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
mycwcgr
Member


Joined: 08 Nov 2003
Posts: 2

PostPosted: 08/11/03 08:09    Post subject: How to exclude folder and subfolder in Tfilefind Reply with quote

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
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 234

PostPosted: 08/11/03 12:34    Post subject: Reply with quote

Instead of the Excluded property you should use the OnFolderChange event. The Excluded property is for filtring files, not folders.
Back to top
View user's profile Send e-mail Visit poster's website
mycwcgr
Member


Joined: 08 Nov 2003
Posts: 2

PostPosted: 09/11/03 00:42    Post subject: Could you give me a sample about how to use OnFolderChange Reply with quote

Could you give me a sample about how to use OnFolderChange event to exclude folder?
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 234

PostPosted: 09/11/03 11:23    Post subject: Reply with quote

Code:
procedure TForm1.FindFile1FolderChange(Sender: TObject;
  const Folder: String; var IgnoreFolder: TFolderIgnore);
begin
  if Pos('c:\my pictures\', LowerCase(Folder)) = 1 then
    IgnoreFolder := True;
end;
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group