delphi编写提取exe文件的ICO图标


本文整理自网络,侵删。

 
会写自己的EXE程序,但没一个好看的EXE图标,是不是很遗憾啊?很多软件都有很好看 的图标,我们为什么不提取出来呢?下面教你怎么用delphi编程提取EXE文件的图标,并保 存为ICO格式的.
代码如下:
 

procedure TForm1.getIcon;  
var  
  Count : Integer;  
  FileName : String;  
  i:integer;  
begin  
  if( FileName <> Edit1.Text ) then  
  begin  
    FileName:=Edit1.Text;  
    I := 0;  
    Count := ExtractIcon( Application.Handle, PChar(FileName),  
    $FFFFFFFF );  
  end  
  else  
    Inc(I);  
  if( I < Count ) then  
    Image1.Picture.Icon.Handle :=  
    ExtractIcon( Application.Handle, PChar(FileName), I )  
  else  
    ShowMessage(’没有找到!’ );  
end;  
procedure TForm1.Button1Click(Sender: TObject);  
begin  
    getIcon;  
end;  
procedure TForm1.Button2Click(Sender: TObject);  
begin  
opendialog1.Execute;  
edit1.Text:=opendialog1.FileName;  
end;  
procedure TForm1.Button3Click(Sender: TObject);  
begin  
 savedialog1.Execute;  
 image1.Picture.SaveToFile(savedialog1.FileName);  
   
end; 

相关阅读 >>

Delphi 获取某个页面所有的链接

Delphi android.os获取sn号

Delphi弹出信息框大全

Delphi 文件的操作:重命名、复制、移动、删除

Delphi 2009 中 tstrings 与 tstream 的增强

Delphi xe5、6、7在android或者ios上使用ansistring和ansichar

Delphi 判断字符是否是汉字,bytetype字符串中判断是否英文

Delphi篇之写托盘图标

Delphi trimleft 删除字符串左边的空格

Delphi xe6 读取android设备联系人

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...