Board index » delphi » Associated icons in TListView

Associated icons in TListView

I've got a list of files placed on the internet, these files should be
added to TListView, which is easy, but I'd like to add the icon
associated with the filetype.
I've used SHGetFileInfo to receive the handle of the system imagelist
and then assigned that imagelist to the listview. By using SHGetFileInfo
again I can get the imageindex for files on the computer, but the files
i want to add isn't on the computer. Any idea on how i can receive the
imageindex for the different extensions?
 

Re:Associated icons in TListView


Quote
Magnusz <magnuszmagn...@hotmail.com> wrote:
>I've got a list of files placed on the internet, these files should be
>added to TListView, which is easy, but I'd like to add the icon
>associated with the filetype.
>I've used SHGetFileInfo to receive the handle of the system imagelist
>and then assigned that imagelist to the listview. By using SHGetFileInfo
>again I can get the imageindex for files on the computer, but the files
>i want to add isn't on the computer. Any idea on how i can receive the
>imageindex for the different extensions?

Well, maybe you could go through registry. Find the extension key in the
HKCR root, and do a recursive key-search for a "DefaultIcon" key.

It's not very simple but it's an idea.

Smola
--
Redundance is futile...

(supersmola.tripod.com/index.htm}

Other Threads