[code lang=”delphi”]Procedure CreateImages;
var
SysIL: HImageList;
SFI: TSHFileInfo;
begin
// Create an image list component
MyTreeView.Images := TImageList.Create(Self);
// This gets the small image list. Replace SHGFI_SMALLICON with
// SHGFI_LARGEICON for large images.
SysIL := SHGetFileInfo(”, 0, SFI, SizeOf(SFI),
SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
if SysIL <> 0 then begin
// Assign the system list to the component
Images.Handle := SysIL;
// The following prevents the image list handle from being
// destroyed when the component is.
Images.ShareImages := TRUE;
end;
End;[/code]
[tags]Delphi, API[/tags]
0 Kommentare zu “System Images”