Recent

Author Topic: ShellTreeView and system icons  (Read 2191 times)

Alexandr F

  • New member
  • *
  • Posts: 25
ShellTreeView and system icons
« on: February 21, 2016, 06:14:51 pm »
I would like to use ShellTreeView with system icons (like in Windows Explorer). I use Windows.

I try next:
 
IconListHandle := SHGetFileInfo('', 0, FileInfo, SizeOf(FileInfo), SHGFI_SYSICONINDEX or SHGFI_SMALLICON);
TreeView_SetImageList(ShellTreeView1.Handle, IconListHandle, TVSIL_NORMAL );

But icons are not displayed. In Delphi 7 this code work properly, icons are displayed.

I'm try to read back a handle of Imagelist form ShellTreeView:

IconListHandle := TreeView_GetImageList(ShellTreeView, TVSIL_NORMAL );

and IconListHandle always is zero (I think should be not zero).
« Last Edit: February 21, 2016, 06:56:27 pm by Alexandr F »

PeterX

  • Sr. Member
  • ****
  • Posts: 326
usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job