现在有10个应用程序……
C:\test1.exe
C:\ex2.exe
C:\ts1.exe
C:\ppy1.exe
C:\st5.exe
C:\es6.exe
C:\tct7.exe
C:\teb8.exe
C:\teq9.exe
C:\teww.exe
----------
把它们放入ListView里
程序名称|程序路径
----------
程序1   |C:\test1.exe
程序2   |C:\ex2.exe
程序3   |C:\ts1.exe
程序4   |C:\ppy1.exe
程序5   |C:\st5.exe
程序6   |C:\es6.exe
程序7   |C:\tct7.exe
程序8   |C:\teb8.exe
程序9   |C:\teq9.exe
程序10  |C:\teww.exe
获取它们的图标
function GetFileIcon(Const FileName:String; Smallicon:Boolean):HICON;
var
Info:TSHFILEINFO;
Flag:Integer;
begin
if Smallicon then
Flag:=(SHGFI_SMALLICON or SHGFI_ICON)
else
Flag:=(SHGFI_LARGEICON or SHGFI_ICON);
SHGetFileInfo(PChar(FileName),0,Info,SizeOf(Info),Flag);
Result:=Info.hicon;
end;
----------
如何利用自己写的GetFileIcon获取它们的图标一起存入Imagelist里……
请高手赐教……

解决方案 »

  1.   

    用 api 函数ExtractIcon扣取exe和dll文件的图标
      

  2.   

    如何利用自己写的GetFileIcon获取它们的图标一起存入Imagelist里……
    =================================================================
    如何理解?是获取该文件里面所有的ICO?还是获取在Windows资源管理器里代表它们的ICO?
      

  3.   

    看楼主练的这么带劲,真是不忍心打断啊,呵呵
    ExtractIconFromFile取得图标
    imagelist的add方法加入
    procedure TForm1.Button1Click(Sender: TObject);
    var b:TBitmap;
    begin
        b:=TBitmap.Create;
        b.LoadFromFile('D:\1.bmp');
        ImageList1.Add(b,b);//第一次用,第二个参数我也不是很清楚
        ToolButton1.ImageIndex:=ImageList1.Count-1;
        b.Free;
    end;
      

  4.   

    procedure GetIconToImageList;
    var
      xIco:TIcon;
    begin
      ImgLis.Clear;
      xIco:=TIcon.Create;
      try
        xIco.Handle := GetFileIcon(FileName,True);
        ImgList.Add(xIco);
      finally
        xIco.Free;
      end; 
    end;
      

  5.   

    The next release of the Delphi product family, code named “DeXter” will further advance developer productivity through enhancements in Code Insight, Code Completion, Code Templates, and refactoring across all the Delphi IDE's language personalities.  Significant language and toolchain enhancements have been made to the Win32 Delphi compiler, including support for operator overloading syntax in Win32 and support for inlining compiler magic functions such as Length().  On the .NET side, ECO III has a plethora of new stuff, including property change triggers and state machine definition and management.DeXter will include support for Win32 C++ programming, ala BCB, alongside Delphi for Win32, Delphi .NET and C#.  C++ coders will benefit from the host of IDE productivity tools developed since the BCB days, including Code Insight, Error Insight, and even refactoring.  And of course, VCL app development in C++!Performance analysis has been a hot item for this release cycle.  You'll notice dramatic improvements not only in the DeXter IDE startup times, but also in the runtime performance of your own Win32 Delphi apps!  Highly optimized routines from the FastCode project have helped, as well has an all new high performance non-blocking multithreaded Delphi memory manager.  DeXter is currently scheduled to be completed and released this year (2005).  It will support development of Win32 VCL applications and .NET 1.x WinForms and VCL.NET applications.  The command line compiler will support building apps for .NET Compact Frameworks, though there will be no IDE designer support for CF in this release.2006 - HighlanderThe next Delphi product cycle after DeXter is code named “Highlander,” and will focus on updating the entire Delphi toolset to support .NET 2.0.  There will be ongoing work for Win32 C++ and Win32 Delphi, but the largest portion of new work in Highlander will be for .NET 2.0.  Delphi.Net language support for generic types, partial classes, and nullable types are pretty much a requirement in .NET 2.0.  We intend to have IDE design surfaces for .NET Compact Frameworks up and running in Highlander (using VCL.NET on CF), as well as support for developing and debugging 64 bit .NET apps written using WinForms and VCL.NET. The current plan is to release Highlander in calendar year 2006.  We're considering releasing tech preview builds for download by registered Delphi customers shortly after .NET 2.0 is released, but that will depend largely upon how quickly we can get the raft of new language syntax nailed down, and upon when Microsoft gets around to actually shipping .NET 2.0.As always, these plans are subject to change.Deferals & DistractionsI apologize for the tardiness of this roadmap update.  This post was originally drafted in February but was put on hold pending closure of some delicate contract negotiations.  When those negotiations were successfully concluded (in May!), I was busy with other Borland business and this post drifted further into the depths of my outbox.  Labor Day found me on the on the brink of the DeXter crunch mode maelstrom, thinking that it might be a good idea to push this post on out there.  (gee, ya think?)  By that time, though, it was considered “too close“ to the planned DeXter “rolling thunder“ campaign, so I reluctantly (and cursing a blue streak) put it back on hold, per Borland request.  At last, the holds are released!  Fly, be free!ok ,you are free now!