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;

联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678