Solved

Extracting program Icons

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

11 Experts available now in Live!

Get 1:1 Help Now