Extracting program Icons

Posted on 2000-02-15
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 ?
Question by:paulstamp
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 14

Expert Comment

ID: 2523454
See HOWTO: Extract an Icon from a Windows Program 


Author Comment

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.
LVL 14

Accepted Solution

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...


Author Comment

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

Expert Comment

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


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 52
how can i unlock a picture file that was loaded in a picturebox in visual c#? 4 115
Add a task in Outlook from access 11 43
Help me. 3 71
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

730 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