Mega Code Archive

 
Categories / Delphi / System
 

Very simple way to extract an Icon from an EXE or DLL file

Title: Very simple way to extract an Icon from an EXE or DLL file. Question: I have seen many examples but this is really very simple. Answer: Here is the code. ................................................................................ uses ShellAPI; ................................................................................ var oIcon : TIcon; begin oIcon := TIcon. Create; oIcon.Handle := ExtractIcon(oIcon.Handle,'E:\SOFTWARE\Win-Me\Setup.exe',0); //Save the Icon to a file. oIcon.SaveToFile('e:\Setup.ico'); oIcon.Free; end; ................................................................................