Hey, it worked. I've put it into a function to make it more organized.
VB Code:
  1. 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
  2. Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
  3.  
  4. 'sFile = The filename you want to search
  5. Private Function GetIconCount(ByVal sFile As String) As Integer
  6.     Dim hIcon As Long
  7.     Dim iCount As Integer
  8.    
  9.     Do
  10.         ExtractIconEx sFile, iCount, hIcon, ByVal 0&, 1
  11.         If hIcon = 0 Then
  12.             Exit Do
  13.         Else
  14.             DestroyIcon hIcon
  15.             iCount = iCount + 1
  16.         End If
  17.     Loop
  18.    
  19.     GetIconCount = iCount
  20. End Function
  21.  
  22. Private Sub Command1_Click()
  23.  
  24.     'Call the function
  25.     icons = GetIconCount("Shell32.dll")
  26.     MsgBox "There are: " & icons & " icons in this file"
  27.  
  28. End Sub