Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Public Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
'to get the handle to the bitmap in your DC (assuming hDC is the variable that represents the DC)
Dim hBitmap As Long
Dim hOldBitmap As Long
Dim picNew As StdPicture
'create a blank 1x1 bitmap
hBitmap = CreateCompatibleBitmap(hDC, 1, 1)
'put this blank bitmap into the DC and save the one that was in it
hOldBitmap = SelectObject(hDC, hBitmap)
'create a new stdpicture object from that handle: the function name is the same, but you'll need
'to modify it like I mention in the other thread
Set picNew = IconToPicture(hOldBitmap)
'restore the old bitmap and delete the created one
DeleteObject SelectObject(hDC, hOldBitmap)