Uses
Windows, messages, sysutils, classes, graphics, controls, forms, shellapi, dialogs;
Type
Tform1 = Class (tform)
Procedure formcreate (Sender: tobject );
Procedure formclose (Sender: tobject; var action: tcloseaction );
Private
{Private Declarations}
Public
{Public declarations}
End;
VaR
Form1: tform1;
Required topicon: timagelist; // create a list of your favorite images
Implementation
{$ R *. DFM}
Procedure tform1.formcreate (Sender: tobject );
VaR ICO: ticon;
SFI: tshfileinfo;
I: integer;
Begin
// Assign a handle to the image list
Required topicon: = timagelist. Create (Self );
Required topicon. Handle: = shgetfileinfo ('', 0, SFI, sizeof (tshfileinfo ),
Shgfi_sysiconindex or shgfi_smallicon );
Required topicon. Required images: = true;
For I: = 0 to operate topicon. Count-1 do
Begin
ICO: = ticon. Create;
Using topicon. getIcon (I, ico );
ICO. savetofile (C: \ icons \ + inttostr (I) +. ico );
ICO. Free;
End;
End;
Procedure tform1.formclose (Sender: tobject; var action: tcloseaction );
Begin
Optional topicon. Free;
End;
End.
Use the icon resource in shell32.dll