Recent

Author Topic: Delphi conversion  (Read 2308 times)

abarchman

  • New Member
  • *
  • Posts: 11
Delphi conversion
« on: December 30, 2017, 05:56:21 am »
I have this piece of code in my Delphi app, of which I have found somewhere and elsewhere on this site.

With Delphi (on Windows OS) I use This code to load system File's ImageList:

var
     SysImageList: uint;
                    SFI: TSHFileInfo;
      SmallImages: TImageList;
                    List: TListView;

begin
  SysImageList:=SHGetFileInfo('',0,SFI,SizeOf(TSHFileInfo),SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
  if SysImageList<>0 then
  begin
   SmallImages.Handle:=SysImageList;
   SmallImages.ShareImages:=TRUE;
   List.Images := SmallImages;
  end;
end;


First off, I do not know how this works.  It looks like just one system icon is assigned to an item in a ListView.

Second, what would the Lazarus/FPC version look like?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Delphi conversion
« Reply #1 on: December 30, 2017, 09:04:48 am »
here http://forum.lazarus.freepascal.org/index.php?topic=753.0 this has some code that might help you out.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

ASerge

  • Hero Member
  • *****
  • Posts: 2475

 

TinyPortal © 2005-2018