你用WIN3.1页上的DirectoryList和FileListBox不可以吗?

解决方案 »

  1.   

    function OpenFolder(sAddress: string; LF:TListView);
    var  
      hFile:TSearchRec;
      itm:TListitem;
    begin
      if Copy(sAddress,Length(sAddress),1)<>'\' then sAddress:=sAddress + '\';
      if FindFirst((sAddress + '*.*'),FaAnyFile,hFile) <> 0 then
      begin
        Application.MessageBox(PChar('无法打开指定目录:'#13#10 + sAddress),'错误',MB_ICONSTOP);
        exit;
      end;    SendMessage(LF.Handle,LVM_SETIMAGELIST,LVSIL_SMALL,SHGetFileInfo('C:\',0,FInfo,SizeOf(FInfo),SHGFI_SYSICONINDEX or SHGFI_SMALLICON));
        SendMessage(LF.Handle,LVM_SETIMAGELIST,LVSIL_NORMAL,SHGetFileInfo('C:\',0,FInfo,SizeOf(FInfo),SHGFI_SYSICONINDEX or SHGFI_LARGEICON));
      end;
      LF.Items.BeginUpdate;
      LF.Items.Clear;
      FindNext(hFile);
      while FindNext(hFile)=0 do
      begin
        SHGetFileInfo(PChar(sAddress + hFile.Name),0,FInfo,SizeOf(FInfo),SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
        itm:=LF.Items.Add;
        itm.Caption:=hFile.Name;
        itm.ImageIndex:=FInfo.iIcon;
      end;
      FindClose(hFile);
      LF.Items.EndUpdate;
      LF.SetFocus;
    end;
      

  2.   

    liang_z(千山一刀之忍者神龟) thomasz2(汤姆克斯2) 两个人的都行