Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Share Me

  • Please share this topic with your friends. Click any of the icons below:
  • Twitter
  • facebook
  • reddit
  • email

how to find files

how to make a file searching with LMDShellList..?

Comments

  • 8 Comments sorted by Votes Date Added
  • There is no built-in search feature (except certainly some sort of manual search in the items list of LMDShellFolder control).
    SearchPack offers search funtionality (including text search).
  • how to use LMDShellList1.FindData() clause..??

  • This is standard functionality of TCustomListView (search Delphi documentation for TCustomListView.FindData).

  • procedure TForm1.search(const PathName, FileName: String; const InDir: boolean);
    var Rec:TSearchRec;
        Path:string;
    begin
      Path:=IncludeTrailingBackslash(PathName);
      if FindFirst(Path+FileName,faAnyFile - faDirectory,Rec)=0 then
        try
          repeat
            ListBox1.Items.Add(Rec.Name);
          until
            FindNext(Rec)<> 0;
        finally
          FindClose(Rec);
        end;

      if not InDir then
        Exit;

      if FindFirst(Path+'*.*', faDirectory, Rec) = 0 then
        try
          repeat
            if ((Rec.Attr and faDirectory) <> 0) and (Rec.Name<>'.') and (Rec.Name<>'..') then
            cari(Path + Rec.Name, FileName,True);
          until
          FindNext(Rec)<>0;
        finally
        FindClose(Rec);
        end;


    I use this to display files in the listbox but how to transform and display on LMDShellListBox.?
    #I'm not fluent in English so I translated it on google
  • >>I use this to display files in the listbox but how to transform and display on LMDShellListBox.?<<
    This is not possible. The control is used to actually display existing folders. For displaying search results, you can use a simple TListView control.
  • can you give me an example.
  • Not sure what you mean. Replace the ListBox1.Items.Add(Rec.Name); and add ListItems instead to a TListView. 
    However I suggest you check e.g. the SearchPack demos. There is exactly the functionality included you are searching (and much more).
Sign In or Register to comment.