Solved

Extracting program Icons

Posted on 2000-02-15
5
199 Views
Last Modified: 2010-05-02
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 ?
0
Comment
Question by:paulstamp
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2523454
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
 
LVL 3

Author Comment

by:paulstamp
ID: 2523589
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
 
LVL 14

Accepted Solution

by:
mcrider earned 70 total points
ID: 2523641
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
 
LVL 3

Author Comment

by:paulstamp
ID: 2523665
Thanks... it was the step setting the image property = the picture property that I was missing.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2523702
Thanks for the points! Glad I could help!


Cheers!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now