Kind thanks to all of you that have replied!
GetMem, this is the best demo i could find around! I would fully support wp that it should have the best place as a reference for all that are fighting with this problem. At least for the Windows part - in the Windows world shell explorer controls without system icons are absolutely not thinkable!
However i have two remarks - please apologize a laz. newbie.
The first thing is that we need interims copies of the icons again - AddIcon, so using not iIcon (index only) but hIcon (access to the icon object) in this operation.
The icons are copied and afterwards they will be accessed again for the drawing.
You will see noticeable speed difference when eg. (this is my standard check) opening windows\system32 with thousand objects; compare the opening time against the ms explorer. Or compare against any Delphi app that was able to to direct icon list attachments by handle assignment, or via TreeVew_SetImageList.
Yes - in most of the normal uses cases it is finely fast and fast enough. Thinking in the perspective of a file explorer there is room for speed improvement.
For those reason, for the Listview i would prefer to use ListView_SetImageList.
The link mentioned by Ally (above) gives a good starting point. As well as that one:
https://forum.lazarus.freepascal.org/index.php/topic,35669.msg236441.html#msg236441Here, see routine TShellListView1FileAdded (although it is not needed and i would not do a call of SHGetFileInfoW for each file added; better do it only once for a folder).
The second thing is: avoid duplication of the copies. The AddIcon will (at least this is my understanding) do 6000 AddIcons of the object and Draws afterwards, and if the folder / node is entered again later, those 6000 objects will be added 6000 times again, Am i right?
At a third visit of the folder, again 6000 adds? Please correct me if i'm in error, i would be glad.
For this reason some of the workarounds i did mention erlier try to accomplish that with a kind of duplicate check; attempts that are working more or less sufficiently.
For those two reasons i was happy about the suggestion of ASerge (use ownerdraw). I was suprised and think it makes a good sense. We could access the icon objects directly, and access them via without unwanted intermediate copy operations, and they will not inflate an Imagelist.
Personally for me and in my special context i'll try if i could achieve results here.
ASerge, did you mean TListView is entirely built by LCL? if it is able to allow Listview_SetImagelist, the more it would be desirable that the treeview allows such similar.
Please correct me if my thinking is wrong. And many thanks again a lot for all of your contributions!