Solved

Extracting program Icons

Posted on 2000-02-15
5
201 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

860 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