procedure TForm1.LoadImageLists;
var
sfi : TSHFileInfo;
SysIL : uint;
LargeImages, SmallImages : TImageList;
begin
LargeImages := TImageList.Create(Form1);
ConvertToHighColor(LargeImages);
SysIL := SHGetFileInfo('
', 0, SFI, SizeOf(SFI), SHGFI_SYSICONINDEX
or SHGFI_LARGEICON);
if SysIL <> 0
then
begin
LargeImages.Handle := SysIL;
LargeImages.ShareImages := TRUE;
end
else
ShowMessage('
Error: ImageList has not Handle');
SmallImages := TImageList.Create(Form1);
ConvertToHighColor(SmallImages);
SysIL := SHGetFileInfo('
', 0, SFI, SizeOf(SFI), SHGFI_SYSICONINDEX
or SHGFI_SMALLICON);
if SysIL <> 0
then
begin
SmallImages.Handle := SysIL;
SmallImages.ShareImages := TRUE;
end
else
ShowMessage('
Error: ImageList has not Handle');
svLog.StateImages := SmallImages;
end;