Will write their own EXE program, but not a good looking exe icon, is not very sorry AH? Many software have very good icons, why don't we extract it? Here's how to use Delphi programming to extract EXE file icon, and save for the ICO format.
The code is as follows:
Proceduretform1.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 image1.picture.icon.handle:= ExtractIcon (Application.handle,pchar (FileName), i) Else ShowMessage (' not found! '); End; Proceduretform1.button1click (sender:tobject); Begin GetIcon; End; Proceduretform1.button2click (sender:tobject); Begin Opendialog1. Execute; Edit1. Text:=opendialog1. FileName; End; Proceduretform1.button3click (sender:tobject); Begin Savedialog1. Execute; Image1. Picture.savetofile (Savedialog1. FileName); End; |
Interface: