如题。请指教。一定给分!

解决方案 »

  1.   

    http://www.soulan.com/kingron/document/delphi/lnk.html
      

  2.   

    还有就是,怎么用ImageList来调用呀?
      

  3.   

    procedure TForm1.FileListBox1Click(Sender: TObject);
    var
      icon : TIcon;
      filename : string;
      i,j : integer;
    begin
      icon := TIcon.Create;
      i := strToInt(intToStr(extractIcon(hInstance,pchar(filename),DWord(-1 ))); 
      for j:=0 to i-1 do
      begin
        icon.Handle := extractIcon(hInstance,pchar(filename),j);
        imageList1.AddIcon(icon);
        inc(i);
      end;
      icon.Free;
    end; 
      

  4.   

    采用如下的代码,你可以用listbox调用
    procedure TForm1.FileListBox1Click(Sender: TObject);
    var
        icon : TIcon;
        filename : string;
        i,j : integer;
        listItem : TListItem;
    begin
        filename := fileListBox1.FileName;
        icon := TIcon.Create;
        i := strToInt(intToStr(extractIcon(hInstance,pchar(filename),DWord(-1))));
        for j:=0 to i-1 do
        begin
            icon.Handle := extractIcon(hInstance,pchar(filename),j);
            listItem := listView1.Items.Add;
            listItem.ImageIndex := imageList1.AddIcon(icon);
            inc(i);
        end;
        icon.Free;
    end;