hello, the dll resource is bad constructed, you should place an icon in each resource, not to put all the icons in the same icon
me cuesta explicarlo en ingles pero lo que esta haciendo es poner un grupo de iconos con diferentes imagenes no varios iconos.
then you can use the api ExtractIcon
Option Explicit
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 ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long
Private Sub Form_Load()
Dim hIcon As Long
Dim sPath As String
Me.AutoRedraw = True
sPath = "C:\Documents and Settings\Administrador\Escritorio\ResourceDLL\ResourceDLL.dll"
hIcon = ExtractIcon(0&, sPath, 0) 'First Icon
Call DrawIcon(Me.hdc, 0, 0, hIcon)
DestroyIcon hIcon
hIcon = ExtractIcon(0&, sPath, 1) 'Second Icon
Call DrawIcon(Me.hdc, 0, 0, hIcon)
DestroyIcon hIcon
End Sub
Related apis
LoadLibrary
LoadIcon
LoadImage
GdipLoadImageFromStream <--- png Resource (advanced)
EnumResourceNames
LoadResource