Extracting program Icons

I'm trying to write a simple routine to extract an icon from a specified file (ActiveX DLL) and add the icon to an imagelist for use in a listview control. I'm using ExtractIcon and DrawIcon APIs to put the icon into a picture box but if I try and save the icon using SavePicture, or use it directly in the Listimages Add method I get "invalid property value" or "invalid picture" respectively. Can anyone tell me what I'm doing wrong ?
LVL 3
paulstampAsked:
Who is Participating?
 
mcriderCommented:
using the code I gave you in the URL you rejected, if after you put the icon in the picturebox, you do:

    Picture1.Picture = Picture1.Image
    SavePicture Picture1.Picture, "C:\windows\desktop\mypic.bmp"


the Save picture will work...


Cheers!
0
 
mcriderCommented:
See HOWTO: Extract an Icon from a Windows Program
http://support.microsoft.com/support/kb/articles/Q185/8/83.ASP?LNG=ENG&SA=MSDN&FR=1 
 

Cheers!
0
 
paulstampAuthor Commented:
This only solves the first part of the question - the bit I had working. Its the transferring of the picture to a listimage (or a file) that gives the error.
0
 
paulstampAuthor Commented:
Thanks... it was the step setting the image property = the picture property that I was missing.
0
 
mcriderCommented:
Thanks for the points! Glad I could help!


Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.