I am using the DrawIcon api from "user32.dll" to put an icon into a picture box, for use in an imagelist. Unfortunately when doing this the icon looses all areas of transparency and ends up with a white backround. Is there any way I can fix this? Here is the code that does it:
Sub AddIcon(ByVal sExecutable As String, ByVal lIconNumber As String, ByVal sExtension As String)
Dim lIcon As Long
Dim lError As Long
frmBrowser.picTemp.Picture = LoadPicture(""
lIcon = ExtractIcon(App.hInstance, sExecutable, lIconNumber)
lError = DrawIcon(frmBrowser.picTemp.hdc, 0, 0, lIcon)
lError = DestroyIcon(lIcon)
frmBrowser.picTemp.Picture = frmBrowser.picTemp.Image
frmBrowser.imglIcons.ListImages.Add , sExtension, frmBrowser.picTemp.Picture
End Sub
Any help would be much appreciated.
Sub AddIcon(ByVal sExecutable As String, ByVal lIconNumber As String, ByVal sExtension As String)
Dim lIcon As Long
Dim lError As Long
frmBrowser.picTemp.Picture = LoadPicture(""
lIcon = ExtractIcon(App.hInstance, sExecutable, lIconNumber)
lError = DrawIcon(frmBrowser.picTemp.hdc, 0, 0, lIcon)
lError = DestroyIcon(lIcon)
frmBrowser.picTemp.Picture = frmBrowser.picTemp.Image
frmBrowser.imglIcons.ListImages.Add , sExtension, frmBrowser.picTemp.Picture
End Sub
Any help would be much appreciated.