Code:
'declarations:
Declare Function ExtractIconEx Lib "shell32" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Long, phIconLarge As Long, phIconSmall As Long, ByVal nIcons As Long) As Long
Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hicon As Long) As Long
'in code:
Dim hicon As Long
ExtractIconEx Filename, 0, hicon, ByVal 0&, 10
DrawIcon Picture1.hdc, 0, 0, hicon
'extracts the icon from filename and draws it on picture1 picturebox
ImageList1.ListImages.Add , Filename, Picture1
'Adds the icon to the a imagelist with the key named as the filename (so that you know what icon you use)
ListView1.ListItems(x).Icon = Filename
'Add the icon in the listview. And don't forget to attach the listview to the imagelist first.