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 带参数的 exit

Delphi 利用hook api函数openprocess与terminateprocess来防止任务管理器结束进程

Delphi 判断字符串是否为纯数字组合

Delphi操作unicode字符

Delphi 10.3版本获取windows系统版本和cpu信息

Delphi memo中禁止汉字

Delphi截图程序无窗口版

Delphi数值转ip

Delphi 获取系统串口列表

Delphi从外部拖拽文件

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



打赏

取消

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

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

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

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

评论

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