VB Code:
Public Declare Function DrawIcon Lib "user32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal hIcon As Long) As Long
Public Declare Function ExtractIcon Lib "shell32" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Public Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
'to get an icon out
Dim hIcon As Long
'remove the first icon in the file
hIcon = ExtractIcon(App.hInstance, "c:\someicons.icl", 0)
'draw it on the form
DrawIcon Me.hDC, 0, 0, hIcon
'destroy the icon (don't forget this)
DestroyIcon hIcon
If you give ExtractIcon a -1 for the nIconIndex param, you'll get back the number of icons inside the file (exe/dll/icl/ico). This example just gives you the handle and a way to draw them somewhere, but if you want an actual StdPicture object with the icon info, you can use the IconToPicture() function I posted in this thread.