VB Code:
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Long, phiconLarge As Long, phiconSmall As Long, ByVal nIcons As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Sub Command1_Click()
Dim hIcon As Long
Dim iCount As Integer
For I = 0 To ExtractIconEx("Shell32.dll", -1, hIcon, ByVal 0&, 1)
ExtractIconEx "Shell32.dll", iCount, hIcon, ByVal 0&, 1
If hIcon <> 0 Then
DrawIcon Picture1.hdc, 0, 0, hIcon
DestroyIcon hIcon
Picture1.Refresh
ImageList1.ListImages.Add , "PIC" & iCount, Picture1.Image
Picture1.Cls
iCount = iCount + 1
End If
Next I
End Sub