如何将shell32.dll中的图标添加到IMAGELIST控件中?(50分)

  • 主题发起人 主题发起人 txbdir
  • 开始时间 开始时间
T

txbdir

Unregistered / Unconfirmed
GUEST, unregistred user!
请问一下,如何将SHLL32.DLL中的图标添加到imagelist控件中?在线等~
 
把他们提取出来直接加入吧,好象没有什么好的办法。
 
对, SHELL32.DLL中的图片很多, 通常情况下只能用软件或自己写代码来提取图标, 推荐一款超好用的图标提取软件, IconLover, 功能很强大~~~
 
procedure TForm1.Button3Click(Sender: TObject);
const
SFile = 'D:/WINDOWS/system32/shell32.dll';
var
i : Integer;
Count : Integer;
hIcon : HWND;
icon : TIcon;
begin
Count := -1;
Count := ExtractIcon(HInstance, SFile, Count);
icon := TIcon.Create;
try
for i := 0 to Count - 1 do
begin
hIcon := ExtractIcon(HInstance, sFile, i);
icon.Handle := hIcon;
imgList.AddIcon(icon);
lstView.Items.Add.ImageIndex := i;
end;
finally
icon.Free;
end;
end;
 
接受答案了.
 
后退
顶部