下面的代码示范了一个完整的提取图标、存储图标的程序:
unit UFormIconGrabber;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ShellAPI, ExtDlgs;
type
TForm1 = class(TForm)
Image1: TImage;
btNextIcon: TButton;
Label1: TLabel;
EditFileName: TEdit;
btBowserFile: TButton;
OpenDialog1: TOpenDialog;
btSaveIco: TButton;
SavePict