TShellListView没有直接的Mask属性吧?

解决方案 »

  1.   

    用TShellListView不太可行吧!我认为你应该参考,Delphi Demos中的Virtual Listview,就可以实现你的目的了!我奇怪的是为什么你的帖子会到头条呢?是斑竹给你加上来的吗?
      

  2.   

    to D_Q(A.Dai)(^o^)(Didi) :
    1.我的帖子会到头条的原因我也不清楚,我是按正常方法贴的。
    2.你的方法我不明白,可能我还是新手,可以的话,麻烦你说清楚点好吗?3.TShellListView做不到,我只好自己做过滤了,开始出现了问题:
    如果文件扩展名是txt,那么Txt\TXt\TXT\tXT\txT\TxT\tXt该怎么办呢?
    有没有办法判断真正的文件类型,而不是根据扩展名的?我的方法:
    var
     i,j:integer;
    fileex:string; j:=1;
      for i:=1 to ShellListView1.Items.Count do
      begin 
         fileex:=ExtractfileExt(ShellListView1.Folders[i-1].PathName);
         if fileex='.txt' then
         begin//loop2           
            j:=j+1;
            StringGrid1.RowCount:=j;
            StringGrid1.Cells[0,j-1]:=fileex;
         end;
      end;
      

  3.   

    Delphi下有个Demo(Virtual Listview)类似TShellListView呀!他可以过滤!你自己看看 用他可以做到的!啊…… 明白了吗????
      

  4.   

    至于扩展名 你可以单独取出来 把他全部换成大写 然后和TXT做比较就可以了
    fileex:=uppercase(ExtractfileExt(ShellListView1.Folders[i-1].PathName));
         if fileex='.TXT' then
         begin//loop2           
            j:=j+1;
            StringGrid1.RowCount:=j;
            StringGrid1.Cells[0,j-1]:=fileex;
         end;
      

  5.   

    /*unit1.pas 谁帮我踢一脚 我不能继续 贴了!!*/
    unit unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      ComCtrls, StdCtrls, ToolWin, ShlObj, ImgList, Menus, ShellCtrls, ExtCtrls;type
      PShellItem = ^TShellItem;
      TShellItem = record
        FullID,
        ID: PItemIDList;
        Empty: Boolean;
        DisplayName,
        TypeName: string;
        ImageIndex,
        Size,
        Attributes: Integer;
        ModDate: string;
      end;  TForm1 = class(TForm)
        ListView: TListView;
        CoolBar1: TCoolBar;
        ToolBar2: TToolBar;
        ToolbarImages: TImageList;
        btnLargeIcons: TToolButton;
        btnSmallIcons: TToolButton;
        btnList: TToolButton;
        btnReport: TToolButton;
        cbPath: TComboBox;
        ToolButton3: TToolButton;
        PopupMenu1: TPopupMenu;
        btnBack: TToolButton;
        ShellTreeView1: TShellTreeView;
        Splitter1: TSplitter;
        procedure FormCreate(Sender: TObject);
        procedure ListViewData(Sender: TObject; Item: TListItem);
        procedure cbPathKeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure cbPathClick(Sender: TObject);
        procedure btnLargeIconsClick(Sender: TObject);
        procedure ListViewDblClick(Sender: TObject);
        procedure ListViewDataHint(Sender: TObject; StartIndex,
          EndIndex: Integer);
        procedure ListViewKeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
          const FindString: String; const FindPosition: TPoint;
          FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
          Wrap: Boolean; var Index: Integer);
        procedure ListViewCustomDrawItem(Sender: TCustomListView;
          Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
        procedure ListViewCustomDrawSubItem(Sender: TCustomListView;
          Item: TListItem; SubItem: Integer; State: TCustomDrawState;
          var DefaultDraw: Boolean);
        procedure btnBackClick(Sender: TObject);
        procedure Form1Close(Sender: TObject; var Action: TCloseAction);
        procedure ShellTreeView1Click(Sender: TObject);
      private
        FPIDL: PItemIDList;
        FIDList: TList;
        FIShellFolder,
        FIDesktopFolder: IShellFolder;
        FPath: string;
        procedure SetPath(const Value: string); overload;
        procedure SetPath(ID: PItemIDList); overload;
        procedure PopulateIDList(ShellFolder: IShellFolder);
        procedure ClearIDList;
        procedure CheckShellItems(StartIndex, EndIndex: Integer);
        function  ShellItem(Index: Integer): PShellItem;
      end;var
      Form1: TForm1;implementation{$R *.dfm}uses ShellAPI, ActiveX, ComObj, CommCtrl;procedure DisposePIDL(ID: PItemIDList);
    var
      Malloc: IMalloc;
    begin
      if ID = nil then Exit;
      OLECheck(SHGetMalloc(Malloc));
      Malloc.Free(ID);
    end;function CopyITEMID(Malloc: IMalloc; ID: PItemIDList): PItemIDList;
    begin
      Result := Malloc.Alloc(ID^.mkid.cb + SizeOf(ID^.mkid.cb));
      CopyMemory(Result, ID, ID^.mkid.cb + SizeOf(ID^.mkid.cb));
    end;function NextPIDL(IDList: PItemIDList): PItemIDList;
    begin
      Result := IDList;
      Inc(PChar(Result), IDList^.mkid.cb);
    end;function GetPIDLSize(IDList: PItemIDList): Integer;
    begin
      Result := 0;
      if Assigned(IDList) then
      begin
        Result := SizeOf(IDList^.mkid.cb);
        while IDList^.mkid.cb <> 0 do
        begin
          Result := Result + IDList^.mkid.cb;
          IDList := NextPIDL(IDList);
        end;
      end;
    end;
    procedure StripLastID(IDList: PItemIDList);
    var
      MarkerID: PItemIDList;
    begin
      MarkerID := IDList;
      if Assigned(IDList) then
      begin
         while IDList.mkid.cb <> 0 do
        begin
          MarkerID := IDList;
          IDList := NextPIDL(IDList);
        end;
        MarkerID.mkid.cb := 0;
      end;
    end;function CreatePIDL(Size: Integer): PItemIDList;
    var
      Malloc: IMalloc;
      HR: HResult;
    begin
      Result := nil;  HR := SHGetMalloc(Malloc);
      if Failed(HR) then
        Exit;  try
        Result := Malloc.Alloc(Size);
        if Assigned(Result) then
          FillChar(Result^, Size, 0);
      finally
      end;
    end;function CopyPIDL(IDList: PItemIDList): PItemIDList;
    var
      Size: Integer;
    begin
      Size := GetPIDLSize(IDList);
      Result := CreatePIDL(Size);
      if Assigned(Result) then
        CopyMemory(Result, IDList, Size);
    end;function ConcatPIDLs(IDList1, IDList2: PItemIDList): PItemIDList;
    var
      cb1, cb2: Integer;
    begin
      if Assigned(IDList1) then
        cb1 := GetPIDLSize(IDList1) - SizeOf(IDList1^.mkid.cb)
      else
        cb1 := 0;  cb2 := GetPIDLSize(IDList2);  Result := CreatePIDL(cb1 + cb2);
      if Assigned(Result) then
      begin
        if Assigned(IDList1) then
          CopyMemory(Result, IDList1, cb1);
        CopyMemory(PChar(Result) + cb1, IDList2, cb2);
      end;
    end;function GetDisplayName(ShellFolder: IShellFolder; PIDL: PItemIDList;
                            ForParsing: Boolean): string;
    var
      StrRet: TStrRet;
      P: PChar;
      Flags: Integer;
    begin
      Result := '';
      if ForParsing then
        Flags := SHGDN_FORPARSING
      else
        Flags := SHGDN_NORMAL;  ShellFolder.GetDisplayNameOf(PIDL, Flags, StrRet);
      case StrRet.uType of
        STRRET_CSTR:
          SetString(Result, StrRet.cStr, lStrLen(StrRet.cStr));
        STRRET_OFFSET:
          begin
            P := @PIDL.mkid.abID[StrRet.uOffset - SizeOf(PIDL.mkid.cb)];
            SetString(Result, P, PIDL.mkid.cb - StrRet.uOffset);
          end;
        STRRET_WSTR:
          Result := StrRet.pOleStr;
      end;
    end;function GetShellImage(PIDL: PItemIDList; Large, Open: Boolean): Integer;
    var
      FileInfo: TSHFileInfo;
      Flags: Integer;
    begin
      FillChar(FileInfo, SizeOf(FileInfo), #0);
      Flags := SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_ICON;
      if Open then Flags := Flags or SHGFI_OPENICON;
      if Large then Flags := Flags or SHGFI_LARGEICON
      else Flags := Flags or SHGFI_SMALLICON;
      SHGetFileInfo(PChar(PIDL),
                    0,
                    FileInfo,
                    SizeOf(FileInfo),
                    Flags);
      Result := FileInfo.iIcon;
    end;
    //没有完…… 不能贴太多……
      

  6.   

    to  D_Q(A.Dai)(阿呆) :
    你的方法解决全部大小写,如果是有大小写混合呢?
    你的代码太长,能简明说明作用吗?
      

  7.   

    很简单:
    procedure TForm1.lv1AddFolder(Sender: TObject; AFolder: TShellFolder;
      var CanAdd: Boolean);
    var s,s1:string;
    begin
      s:=AFolder.pathname;
      s1:=Copy(s,length(s)-2, 3);
      if (s1<>'txt')  then
      CanAdd:=false
      else
      CanAdd:=true;
    end;别忘了给分啊!
      

  8.   

    //-------------------------------
    //---继续1
    function IsFolder(ShellFolder: IShellFolder; ID: PItemIDList): Boolean;
    var
      Flags: UINT;
    begin
      Flags := SFGAO_FOLDER;
      ShellFolder.GetAttributesOf(1, ID, Flags);
      Result := SFGAO_FOLDER and Flags <> 0;
    end;function ListSortFunc(Item1, Item2: Pointer): Integer;
    begin
      Result := SmallInt(Form1.FIShellFolder.CompareIDs(
                      0,
                      PShellItem(Item1).ID,
                      PShellItem(Item2).ID
                ));
    end;procedure TForm1.FormCreate(Sender: TObject);
    var
      FileInfo: TSHFileInfo;
      ImageListHandle: THandle;
      NewPIDL: PItemIDList;
    begin
      OLECheck(SHGetDesktopFolder(FIDesktopFolder));
      FIShellFolder := FIDesktopFolder;
      FIDList := TList.Create;
      ImageListHandle := SHGetFileInfo('C:\',
                               0,
                               FileInfo,
                               SizeOf(FileInfo),
                               SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
      SendMessage(ListView.Handle, LVM_SETIMAGELIST, LVSIL_SMALL, ImageListHandle);  ImageListHandle := SHGetFileInfo('C:\',
                               0,
                               FileInfo,
                               SizeOf(FileInfo),
                               SHGFI_SYSICONINDEX or SHGFI_LARGEICON);  SendMessage(ListView.Handle, LVM_SETIMAGELIST, LVSIL_NORMAL, ImageListHandle);
      OLECheck(
        SHGetSpecialFolderLocation(
          Application.Handle,
          CSIDL_DRIVES,
          NewPIDL)
      );
      SetPath(NewPIDL);
      ActiveControl := cbPath;
      cbPath.SelStart := 0;
      cbPath.SelLength := Length(cbPath.Text);
    end;procedure TForm1.cbPathKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if Key = VK_RETURN then
      begin
        if cbPath.Text[Length(cbPath.Text)] = ':' then
          cbPath.Text := cbPath.Text + '\';
        SetPath(cbPath.Text);
        Key := 0;
      end;
    end;procedure TForm1.cbPathClick(Sender: TObject);
    var
      I: Integer;
    begin
      I := cbPath.Items.IndexOf(cbPath.Text);
      if I >= 0 then
        SetPath(PItemIDList(cbPath.Items.Objects[I]))
      else
        SetPath(cbPath.Text);
    end;procedure TForm1.btnLargeIconsClick(Sender: TObject);
    begin
      ListView.ViewStyle := TViewStyle((Sender as TComponent).Tag);
    end;procedure TForm1.ListViewDblClick(Sender: TObject);
    var
      RootPIDL,
      ID: PItemIDList;
    begin
      if ListView.Selected <> nil then
      begin
        ID := ShellItem(ListView.Selected.Index).ID;
        if not IsFolder(FIShellFolder, ID) then Exit;
        RootPIDL := ConcatPIDLs(FPIDL, ID);
        SetPath(RootPIDL);
      end;
    end;function TForm1.ShellItem(Index: Integer): PShellItem;
    begin
      Result := PShellItem(FIDList[Index]);
    end;procedure TForm1.ListViewKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      case Key of
        VK_RETURN:
          ListViewDblClick(Sender);
        VK_BACK:
          btnBackClick(Sender);
      end;
    end;procedure TForm1.ClearIDList;
    var
      I: Integer;
    begin
      for I := 0 to FIDList.Count-1 do
      begin
        DisposePIDL(ShellItem(I).ID);
        Dispose(ShellItem(I));
      end;
      FIDList.Clear;
    end;procedure TForm1.PopulateIDList(ShellFolder: IShellFolder);
    const
      Flags = SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN;
    var
      ID: PItemIDList;
      EnumList: IEnumIDList;
      NumIDs: LongWord;
      SaveCursor: TCursor;
      ShellItem: PShellItem;
    begin
      SaveCursor := Screen.Cursor;
      try
        Screen.Cursor := crHourglass;
        OleCheck(
          ShellFolder.EnumObjects(
            Application.Handle,
            Flags,
            EnumList)
        );    FIShellFolder := ShellFolder;
        ClearIDList;
        while EnumList.Next(1, ID, NumIDs) = S_OK do
        begin
          ShellItem := New(PShellItem);
          ShellItem.ID := ID;
          ShellItem.DisplayName := GetDisplayName(FIShellFolder, ID, False);
          ShellItem.Empty := True;
          //过滤文件的地方
          if((uppercase(ExtractfileExt(ShellItem.DisplayName))='.TXT')or(ExtractfileExt(ShellItem.DisplayName)='')) then
            FIDList.Add(ShellItem);
        end;
        FIDList.Sort(ListSortFunc);
        ListView.Items.Count := FIDList.Count;
        ListView.Repaint;
      finally
        Screen.Cursor := SaveCursor;
      end;
    end;procedure TForm1.SetPath(const Value: string);
    var
      P: PWideChar;
      NewPIDL: PItemIDList;
      Flags,
      NumChars: LongWord;
    begin
      NumChars := Length(Value);
      Flags := 0;
      P := StringToOleStr(Value);  OLECheck(
        FIDesktopFolder.ParseDisplayName(
          Application.Handle,
          nil,
          P,
          NumChars,
          NewPIDL,
          Flags)
       );  SetPath(NewPIDL);
    end;
      

  9.   

    //-------------------------------
    //---继续2
    procedure TForm1.SetPath(ID: PItemIDList);
    var
      Index: Integer;
      NewShellFolder: IShellFolder;
    begin
       OLECheck(
         FIDesktopFolder.BindToObject(
                ID,
                nil,
                IID_IShellFolder,
                Pointer(NewShellFolder))
       );  ListView.Items.BeginUpdate;
      try
        PopulateIDList(NewShellFolder);
        FPIDL := ID;
        FPath := GetDisplayName(FIDesktopFolder, FPIDL, True);
        Index := cbPath.Items.IndexOf(FPath);
        if (Index < 0) then
        begin
          cbPath.Items.InsertObject(0, FPath, Pointer(FPIDL));
          cbPath.Text := cbPath.Items[0];
        end
        else begin
          cbPath.ItemIndex := Index;
          cbPath.Text := cbPath.Items[cbPath.ItemIndex];
        end;
        if ListView.Items.Count > 0 then
        begin
          ListView.Selected := ListView.Items[0];
          ListView.Selected.Focused := True;
          ListView.Selected.MakeVisible(False);
        end;  finally
        ListView.Items.EndUpdate;
      end;
    end;procedure TForm1.CheckShellItems(StartIndex, EndIndex: Integer);
     function ValidFileTime(FileTime: TFileTime): Boolean;
     begin
       Result := (FileTime.dwLowDateTime <> 0) or (FileTime.dwHighDateTime <> 0);
     end;
    var
      FileData: TWin32FindData;
      FileInfo: TSHFileInfo;
      SysTime: TSystemTime;
      I: Integer;
      LocalFileTime: TFILETIME;
    begin
      for I := StartIndex to EndIndex do
      begin
        if ShellItem(I)^.Empty then
        with ShellItem(I)^ do
        begin
          FullID := ConcatPIDLs(FPIDL, ID);
          ImageIndex := GetShellImage(FullID, ListView.ViewStyle = vsIcon, False);
          //File Type
          SHGetFileInfo(
            PChar(FullID),
            0,
            FileInfo,
            SizeOf(FileInfo),
            SHGFI_TYPENAME or SHGFI_PIDL
          );
          TypeName := FileInfo.szTypeName;
          //Get File info from Windows
          FillChar(FileData, SizeOf(FileData), #0);
          SHGetDataFromIDList(
            FIShellFolder,
            ID,
            SHGDFIL_FINDDATA,
            @FileData,
            SizeOf(FileData)
          );
          //File Size, in KB
          Size := (FileData.nFileSizeLow + 1023 ) div 1024;
          if Size = 0 then Size := 1;
          //Modified Date
          FillChar(LocalFileTime, SizeOf(TFileTime), #0);
          with FileData do
            if ValidFileTime(ftLastWriteTime)
            and FileTimeToLocalFileTime(ftLastWriteTime, LocalFileTime)
            and FileTimeToSystemTime(LocalFileTime, SysTime) then
            try
              ModDate := DateTimeToStr(SystemTimeToDateTime(SysTime))
            except
              on EConvertError do ModDate := '';
            end
            else
              ModDate := '';
          //Attributes
          Attributes := FileData.dwFileAttributes;
          //Flag this record as complete.
          Empty := False;
        end;
      end;
    end;procedure TForm1.ListViewDataHint(Sender: TObject; StartIndex,
      EndIndex: Integer);
    begin
      if (StartIndex > FIDList.Count) or (EndIndex > FIDList.Count) then Exit;
      CheckShellItems(StartIndex, EndIndex);
    end;procedure TForm1.ListViewData(Sender: TObject; Item: TListItem);
    var
      Attrs: string;
    begin
      if (Item.Index > FIDList.Count) then Exit;
      with ShellItem(Item.Index)^ do
      begin
        Item.Caption := DisplayName;
        Item.ImageIndex := ImageIndex;
        if ListView.ViewStyle <> vsReport then Exit;
        if not IsFolder(FIShellFolder, ID) then
          Item.SubItems.Add(Format('%dKB', [Size]))
        else
          Item.SubItems.Add('');
        Item.SubItems.Add(TypeName);
        try
          Item.SubItems.Add(ModDate);
        except
        end;
        if Bool(Attributes and FILE_ATTRIBUTE_READONLY) then Attrs := Attrs + 'R';
        if Bool(Attributes and FILE_ATTRIBUTE_HIDDEN) then Attrs := Attrs + 'H';
        if Bool(Attributes and FILE_ATTRIBUTE_SYSTEM) then Attrs := Attrs + 'S';
        if Bool(Attributes and FILE_ATTRIBUTE_ARCHIVE) then Attrs := Attrs + 'A';
      end;
      Item.SubItems.Add(Attrs);
    end;procedure TForm1.ListViewDataFind(Sender: TObject; Find: TItemFind;
      const FindString: String; const FindPosition: TPoint; FindData: Pointer;
      StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
      var Index: Integer);
    var
      I: Integer;
      Found: Boolean;
    begin
      I := StartIndex;
      if (Find = ifExactString) or (Find = ifPartialString) then
      begin
        repeat
          if (I = FIDList.Count-1) then
            if Wrap then I := 0 else Exit;
          Found := Pos(UpperCase(FindString), UpperCase(ShellItem(I)^.DisplayName)) = 1;
          Inc(I);
        until Found or (I = StartIndex);
        if Found then Index := I-1;
      end;
    end;procedure TForm1.ListViewCustomDrawItem(Sender: TCustomListView;
      Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
    var
      Attrs: Integer;
    begin
      if Item = nil then Exit;
      Attrs := ShellItem(Item.Index).Attributes;
      if Bool(Attrs and FILE_ATTRIBUTE_READONLY) then
        ListView.Canvas.Font.Color := clGrayText;
      if Bool(Attrs and FILE_ATTRIBUTE_HIDDEN) then
        ListView.Canvas.Font.Style :=
           ListView.Canvas.Font.Style + [fsStrikeOut];
      if Bool(Attrs and FILE_ATTRIBUTE_SYSTEM) then
        Listview.Canvas.Font.Color := clHighlight;
    end;procedure TForm1.ListViewCustomDrawSubItem(Sender: TCustomListView;
      Item: TListItem; SubItem: Integer; State: TCustomDrawState;
      var DefaultDraw: Boolean);
    begin
      if SubItem = 0 then Exit;
      ListView.Canvas.Font.Color := GetSysColor(COLOR_WINDOWTEXT);
    end;procedure TForm1.btnBackClick(Sender: TObject);
    var
      Temp: PItemIDList;
    begin
      Temp := CopyPIDL(FPIDL);
      if Assigned(Temp) then
        StripLastID(Temp);
      if Temp.mkid.cb <> 0 then
        SetPath(Temp)
      else
        Beep;
    end;procedure TForm1.Form1Close(Sender: TObject; var Action: TCloseAction);
    begin
      ClearIDList;
      FIDList.Free;
    end;procedure TForm1.ShellTreeView1Click(Sender: TObject);
    begin
      SetPath(ShellTreeView1.Path);
    end;end.
      

  10.   

    unit1.dfm文件如下object Form1: TForm1
      Left = 306
      Top = 241
      Width = 603
      Height = 448
      Caption = '可以过滤文件的TShellListView'
      Color = clBtnFace
      Font.Charset = GB2312_CHARSET
      Font.Color = clWindowText
      Font.Height = -12
      Font.Name = '宋体'
      Font.Style = []
      OldCreateOrder = True
      Position = poScreenCenter
      Visible = True
      OnClose = Form1Close
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 12
      object Splitter1: TSplitter
        Left = 121
        Top = 55
        Width = 1
        Height = 366
      end
      object ListView: TListView
        Left = 122
        Top = 55
        Width = 473
        Height = 366
        Align = alClient
        Columns = <
          item
            Caption = '文件名称'
            Width = 175
          end
          item
            Alignment = taRightJustify
            Caption = '文件大小'
            Width = 75
          end
          item
            Caption = '文件类型'
            Width = 150
          end
          item
            Caption = '修改时间'
            Width = 100
          end
          item
            Alignment = taRightJustify
            Caption = '文件属性'
            Width = 75
          end>
        OwnerData = True
        ReadOnly = True
        TabOrder = 0
        ViewStyle = vsReport
        OnCustomDrawItem = ListViewCustomDrawItem
        OnCustomDrawSubItem = ListViewCustomDrawSubItem
        OnData = ListViewData
        OnDataFind = ListViewDataFind
        OnDataHint = ListViewDataHint
        OnDblClick = ListViewDblClick
        OnKeyDown = ListViewKeyDown
      end
      object CoolBar1: TCoolBar
        Left = 0
        Top = 0
        Width = 595
        Height = 55
        AutoSize = True
        Bands = <
          item
            Control = ToolBar2
            ImageIndex = -1
            MinHeight = 29
            Width = 591
          end
          item
            Control = cbPath
            ImageIndex = -1
            MinHeight = 20
            Width = 591
          end>
        object ToolBar2: TToolBar
          Left = 9
          Top = 0
          Width = 578
          Height = 29
          AutoSize = True
          ButtonHeight = 27
          ButtonWidth = 28
          Caption = 'ToolBar2'
          Flat = True
          Images = ToolbarImages
          TabOrder = 0
          object btnBack: TToolButton
            Left = 0
            Top = 0
            Caption = 'btnBack'
            ImageIndex = 5
            OnClick = btnBackClick
          end
          object ToolButton3: TToolButton
            Left = 28
            Top = 0
            Width = 8
            Caption = 'ToolButton3'
            ImageIndex = 5
            Style = tbsSeparator
          end
          object btnLargeIcons: TToolButton
            Left = 36
            Top = 0
            Caption = 'btnLargeIcons'
            Grouped = True
            ImageIndex = 1
            Style = tbsCheck
            OnClick = btnLargeIconsClick
          end
          object btnSmallIcons: TToolButton
            Tag = 1
            Left = 64
            Top = 0
            Caption = 'btnSmallIcons'
            Grouped = True
            ImageIndex = 2
            Style = tbsCheck
            OnClick = btnLargeIconsClick
          end
          object btnList: TToolButton
            Tag = 2
            Left = 92
            Top = 0
            Caption = 'btnList'
            Grouped = True
            ImageIndex = 3
            Style = tbsCheck
            OnClick = btnLargeIconsClick
          end
          object btnReport: TToolButton
            Tag = 3
            Left = 120
            Top = 0
            Caption = 'btnReport'
            Grouped = True
            ImageIndex = 4
            Style = tbsCheck
            OnClick = btnLargeIconsClick
          end
        end
        object cbPath: TComboBox
          Left = 9
          Top = 31
          Width = 578
          Height = 20
          ItemHeight = 12
          TabOrder = 1
          OnClick = cbPathClick
          OnKeyDown = cbPathKeyDown
        end
      end
      object ShellTreeView1: TShellTreeView
        Left = 0
        Top = 55
        Width = 121
        Height = 366
        ObjectTypes = [otFolders]
        Root = 'rfMyComputer'
        UseShellImages = True
        Align = alLeft
        AutoRefresh = False
        Indent = 19
        ParentColor = False
        RightClickSelect = True
        ShowRoot = False
        TabOrder = 2
        OnClick = ShellTreeView1Click
      end
      object ToolbarImages: TImageList
        Height = 21
        Width = 21
        Left = 72
        Top = 128
      

  11.   

    Bitmap = {
          494C010106000A00040015001500FFFFFFFF0110FFFFFFFFFFFFFFFF424D7600
          0000000000007600000028000000540000003F0000000100040000000000D40A
          0000000000000000000000000000000000000000000000008000008000000080
          8000800000008000800080800000C0C0C000808080000000FF0000FF000000FF
          FF00FF000000FF00FF00FFFF0000FFFFFF000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000040
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000400000000000000000
          0000FBFBFBFBFBFBF00000000000000000000000000000000000000000000000
          0000000000000000000000000000BFBFBFBFBFBFB00000000000000000000000
          0000000000000000000000000000004000000000000000000000FBFB000000FB
          F000000000000000000000000000000000000000000000000000000000000000
          000000000000BFBF0FBFBFBFB000000000000000000000000000000000000000
          000000000000004000000000000000000000FBFB0BFBFBFBF000000000000000
          000000000000000000000000000000000000000000000000000000000000BF00
          000FBFBFB0000000000000000000000000000000000000000000000000000040
          00000000000000000000FBF000FBFBFBF0000000000000000000000000000000
          00000000000000000000000000000000000000000000BFBF0FBFBFBFB0000000
          0000000000000000000000000000000000000000000000444444444444444400
          0000FBFBFBFBFBFBF00000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          00000000000000000000000000000000000000000000000000000BFBFB000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
      

  12.   

    Bitmap = {
          494C010106000A00040015001500FFFFFFFF0110FFFFFFFFFFFFFFFF424D7600
          0000000000007600000028000000540000003F0000000100040000000000D40A
          0000000000000000000000000000000000000000000000008000008000000080
          8000800000008000800080800000C0C0C000808080000000FF0000FF000000FF
          FF00FF000000FF00FF00FFFF0000FFFFFF000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000040
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000400000000000000000
          0000FBFBFBFBFBFBF00000000000000000000000000000000000000000000000
          0000000000000000000000000000BFBFBFBFBFBFB00000000000000000000000
          0000000000000000000000000000004000000000000000000000FBFB000000FB
          F000000000000000000000000000000000000000000000000000000000000000
          000000000000BFBF0FBFBFBFB000000000000000000000000000000000000000
          000000000000004000000000000000000000FBFB0BFBFBFBF000000000000000
          000000000000000000000000000000000000000000000000000000000000BF00
          000FBFBFB0000000000000000000000000000000000000000000000000000040
          00000000000000000000FBF000FBFBFBF0000000000000000000000000000000
          00000000000000000000000000000000000000000000BFBF0FBFBFBFB0000000
          0000000000000000000000000000000000000000000000444444444444444400
          0000FBFBFBFBFBFBF00000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          00000000000000000000000000000000000000000000000000000BFBFB000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
      

  13.   

    0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000008880
          0000888000000000000000000000000000044400000000000000044400000444
          000000000000000000888088008880880000000000000444400000000004F400
          00000000000004F4000004F40000000000000000080888880008888800000000
          000004FF40000000000440000000000000000440000004400000000000000000
          800000008880000000000000000004FF40000000000000000000000000000000
          0000000000000000000000808008F0000008F00000000000000004F440000000
          000000000000000000000000000000000000000000000088008FFF00008FFF00
          0000000000000444000000000000000044400000000004440000044400000000
          0000000000FFFFF000FFFFF0000000000000000000000000000000004F400000
          000004F4000004F40000000000000000008FFF00008FFF000000044440000000
          000000000000000044000000000004400000044000000000000000000008F800
          0008F800000004FF400000000000000000000000000000000000000000000000
          00000000000000000000000000000000000004FF400000000000000000000000
          00000000000000000000000000000000000000000000000000000000000004F4
          4000000000000000044400000000000000000444000004440000000000000000
          000000000000000000000444000000000000000004F4000000000000000004F4
          000004F400000000000000000000000000000000000000000000000000000000
          0440000000000000000004400000044000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          000000000000424D3E000000000000003E00000028000000540000003F000000
          0100010000000000F40200000000000000000000000000000000000000000000
          FFFFFF0000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          FFFFFFFFFFC0000000000000FFFFFFFFFFC0000000000000FFFFFFFFFFC00000
          00000000FFFFFFFFFFC0000000000000D8447FFFFFC0000000000000FFFFFE00
          03C0000000000000D8447E0003C0000000000000FFFFFE0003C0000000000000
          D8447E0003C0000000000000FFFFFE0003C0000000000000D8447E0003C00000
          00000000FFFFFE0003C0000000000000D8447E0003C0000000000000FFFFFE00
          03C0000000000000C0003E0003C0000000000000FFFFFE0007C0000000000000
          F8447F01FFC0000000000000FFFFFF83FFC0000000000000FFFFFFFFFFC00000
          00000000FFFFFFFFFFC0000000000000FFFFFFFFFFC0000000000000FFFFFFFF
          FFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFF000
          FFFFFFFF03FFFFFFFFFFF000FF1F1FFFFFFE3FFF8F8FF000FC4C4FFF87FE23FF
          8888F000FA0E0FFF87FE7FFF9F9FF000F6303FFF87FFFFFFFFFFF000D45C5FFF
          87FFFFFFFFFFF000C8282F038FFFF1FF8F8FF000F8080FFFFFFFF11F8888F000
          D8202F87FFFFF3FF9F9FF000B0001F87FFFFFFFFFFFFF000B6363F87FFFFFFFF
          FFFFF000A7F4FF87FFF8FFFF8F8FF000CFF9FF8FFFF88FFF8888F000FFFFFFFF
          FFF9FFFF9F9FF000FFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFF000
          FFFFFFFFFFFFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFF0000000000000000000
          0000000000000000000000000000}
      end
      object PopupMenu1: TPopupMenu
        Left = 160
        Top = 128
      end
    end
      

  14.   

    复原出错,请你发到[email protected]好吗?最好说一下原理,马上结帐!
      

  15.   

    问题:楼上的兄弟,你的方法坐不到不去分大小些,有没有这个函数呢?
    回答:变大写,是给你做比较的!
    fileex:=ExtractfileExt(ShellListView1.Folders[i-1].PathName);
         if uppercase(fileex)='.TXT' then
         begin//loop2           
            j:=j+1;
            StringGrid1.RowCount:=j;
            StringGrid1.Cells[0,j-1]:=fileex;//加的还是你以前的数据
         end;
    {那有什么区别吗?转成全部大写是做比较用的…… 这样就可以解决你说的Txt tXt txT TXt…… 了!}
      

  16.   

    我这里 速度慢的要死…… CSDN总出错…… 邮件发不出去…… 呜呜……
      

  17.   

    上面的程序 就是你需要的…… 哈哈 可以过滤的ListView…… 哈哈
    你留下QQ号码吧,我发给你 邮件…… 我发不出去。速度太慢了……