You should use the OleCreatePictureIndirect function to convert the icon handle returned by ExtractIcon function to a picture object.
The DrawIcon method looses the transparency of the icon because the picture object returned by the image property of the picture box is not of type icon, but type bitmap which looses tranparency.
On the other hand the following function, IconHandleToPicture preserves the transparency. It does not even need a picture box to work with. See the example code that follows.
Place an image list (ImageList1) on the form and insert the following code.
___
[tt]
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 OleCreatePictureIndirect Lib "olepro32.dll" (lpPictDesc As PICTDESC, riid As Any, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
Private Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Declare Function CLSIDFromString Lib "ole32" (ByVal lpstrCLSID As Long, lpCLSID As Any) As Long
Private Type PICTDESC
cbSizeofStruct As Long
picType As Long
hImage As Long
xExt As Long
yExt As Long
End Type
Public Function IconHandleToPicture(ByVal hIcon As Long) As IPicture
Dim pd As PICTDESC, IPic(15) As Byte
If hIcon = 0 Then Exit Function
pd.cbSizeofStruct = Len(pd)
pd.picType = vbPicTypeIcon
pd.hImage = hIcon
CLSIDFromString StrPtr("{7BF80980-BF32-101A-8BBB-00AA00300CAB}"

, IPic(0)
OleCreatePictureIndirect pd, IPic(0), True, IconHandleToPicture
End Function
Private Sub Form_Click()
BackColor = vbWhite * Rnd
End Sub
Private Sub Form_Load()
Dim hIcon As Long
'extract icon handle from dll
hIcon = ExtractIcon(0, "user32.dll", 1)
'convert icon handle to picture
'and add it to the image list
ImageList1.ListImages.Add , , IconHandleToPicture(hIcon)
'assign to picture property the
'first image in the image list
Me.Picture = ImageList1.ListImages(1).Picture
Randomize
End Sub[/tt]
___
It will extract an icon from user32.dll, convert it to a picture object using IconHandleToPicture function preserving its transparency, add this picture to the image list and assign this image list picture to the picture property of the form.
When you click on the form, it will randomly change the background color of the form and you will see that this change in background color is also reflected in the transparent areas of the icon.
Note that you do not need to destroy the icon handle using DestroyIcon function. When the icon handle in converted to a picture object, the object instance takes care of the destruction of the icon itself.