怎样提取EXE文件的大图标,注意,是大图标,高手请指教!

Liusp 2001-11-15 12:27:11
...全文
164 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
taxi 2001-11-15
  • 打赏
  • 举报
回复
procedure TForm1.ExtractFileIcon(const FileName: string);
var
i: integer;
begin
i := 0;
Image1.Picture.Icon.handle := ExtractIcon(Hinstance, Pchar(FileName), i);
end;
Liusp 2001-11-15
  • 打赏
  • 举报
回复
用代码实现
Liusp 2001-11-15
  • 打赏
  • 举报
回复
我自己回答吧,用API函数
ExtractIconEx(
LPCSTR lpszFile,
int nIconIndex,
HICON FAR * phiconLarge,
HICON FAR * phiconSmall,
UINT nIcons
);
windlucky 2001-11-15
  • 打赏
  • 举报
回复
大家的方式,很好呀!不能解决!能不能说的详细点?
chenjiong 2001-11-15
  • 打赏
  • 举报
回复
是啊,提取图标的软件太多了。实在不行可以找个汉化的工具,可以把软件中的所有图片都导出。
Kingron 2001-11-15
  • 打赏
  • 举报
回复
SHGetFileInfo()其中有一个大图标的的参数
kevin_gao 2001-11-15
  • 打赏
  • 举报
回复
大图标?怎么个大图标法?

好多提取图标的工具,难道不能满足?
taxi 2001-11-15
  • 打赏
  • 举报
回复
文件类型可以是exe,dll,icl
taxi 2001-11-15
  • 打赏
  • 举报
回复
以上是取一个图标显示在TImage中,下面是提取所有的图标显示在ListView中
首先,在窗体放一个ImageList,Width and Height = 32,放一个ListView,LargeIcon属性设为ImageList1,为了好看,再窗体底部放一个ProgressBar,align= alBottom
procedure TForm1.ExtractFileIcon(const FileName: string);
var
i, iCount: integer;
Icon: TIcon;
begin
i := -1;
iCount := ExtractIcon(Hinstance, Pchar(FileName), i);
ProgressBar.Max := iCount;
ListView1.Items.BeginUpdate;
ListView1.Items.Clear;
Icon := TIcon.Create;
for i := 0 to iCount -1 do
begin
Icon.Handle := ExtractIcon(Hinstance, Pchar(FileName), i);
ImageList.AddIcon(Icon);
with ListView1.Items.Add do
begin
Caption := ExtractFileName(FileName) + '[' + IntToStr(i + 1) + ']';
ImageIndex := Items.Count - 1;
end;
ProgressBAr.Position := i;
end;
ListView1.Items.EndUpdate;
ProgressBar.Position := 0;
end;

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧