by Tom de Lange (5 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (26 Votes)
This project demonstrates how to extract large and small icons associated with files into an imagelist and displaying them in a listview with
the filenames. The SHGetFileInfo function of the shell32.dll library is used, which makes the job much easier than before. The ImageList_Draw
function in comctl32.dll is used to draw the icon in a picture box,from where it is placed into the image list. Other submissions on VBC do an OK job on large icons, but the small icons are a mess. Not here! Credits to Peter Meier for his DelRecent posting.
Side Effects
ImageList can't hold more than 400 icons, so check duplicates.
API DeclarationsSHGetFileInfo() in shell32.dll
ImageList_Draw() in comctl32.dll