LMDGraphics.pasのGetIconResourceNamesを使ってアイコンリソース名を列挙するサンプル。
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, LMDGraphics; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var hModule: THandle; irnNames: TIconResourceNames; i: Integer; begin if OpenDialog1.Execute then begin hModule := LoadLibrary(PChar(OpenDialog1.Files[0])); if hModule <> 0 then begin Memo1.Clear; irnNames := GetIconResourceNames(hModule); for i := Low(irnNames) to High(irnNames) do Memo1.Lines.Add(irnNames[i]); FreeLibrary(hModule); end; end; end; end.
サンプルプログラムのソース
lmdiconresnames.zip