Unit iconobject;
Interface
Uses Windows, Messages, Sysutils, Classes, Graphics, Controls, Forms, Dialogs, Stdctrls, Shellapi, COMOBJ, COMCTRLS
Type TFORM1 = Class (TFORM) listview1: TListView;
Procedure formcreate; procedure formclose (Sender: TpoBject; var Action: tclosection); private {private declarations} public {public declarations}
END;
Var Form1: TFORM1; Desktopicon: Timagelist; Implementation
{$ R * .dfm}
procedure TForm1.FormCreate (Sender: TObject); Var Sfi: TSHFileInfo; I: Integer; ListItem: TListItem; begin // output all of the windows 95/98/2000 icon DesktopIcon: = TImageList.Create (Self); DesktopIcon.Handle: = SHGetFileInfo ( '', 0, sfi, SizeOf (TSHFileInfo), shGFI_SYSICONINDEX or SHGFI_SMALLICON); DesktopIcon.ShareImages: = TRUE; ListView1.SmallImages: = desktopicon; For I: = 0 to 255 -1 do With ListView1 do Begin ListItem: = Items.add; listitem.caption: = INTTOSTR (i); ListItem.imageIndex: = i; end;
Procedure TFORM1.FORMCLOSE (Sender: TpoBject; VAR Action: Tclosection); Begin Desktopicon.free;
End.