我不知道帮 你   UP 

解决方案 »

  1.   

    procedure TfrmMain.ExtractFileIcon(Filename:string);
    var
      count,index,i:integer;
      j:word;
      ext:string;
      Ico: TIcon;
    begin
      ListView.Items.BeginUpdate;
      ext := LowerCase(ExtractFileExt(Filename));
      if (ext = '.exe') or (ext = '.dll') or (ext = '.icl') then
      begin
        Ico := TIcon.Create;
        index := -1;
        count := ExtractIcon(Hinstance, Pchar(Filename), index);
        ProgressBar1.Max := count;
        for i := 0 to count - 1 do
        begin
          ProgressBar1.Position := i+1;
          Ico.Handle := ExtractIcon(Hinstance, Pchar(Filename), i);
          //Ico.SaveToFile
          ImageList1.AddIcon(Ico);
          with ListView do
          begin
            Items.Add;
            Items[Items.Count - 1].Caption := IntToStr(i + 1);
            Items[Items.Count - 1].ImageIndex := Items.Count - 1;
          end;
          Application.ProcessMessages;
        end
      end;
      ListView1.Items.EndUpdate;
      ProgressBar.Position := 0;
    end;