Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Icons to ImageList Using hIcon

Status
Not open for further replies.

Derm

Programmer
Apr 10, 2001
9
CA
Hi:

I've been using the SHGetFileInfo API function to obtain file-type specific information on various files. I've extracted the file description text without problem. This function also returns the associated file-type icon as an icon handle (hIcon). I would like to add selected icons to an ActiveX ImageList. I've searched, but there seems to be no way to add images to an ImageList when all you have to work with is hIcons. Anyone know how?

I've also seen mention of a routine called IExtractIcon, which they say is simpler, but I have no way of knowing how to use this in FoxPro, or if it's even possible.

Any help would be appreciated.

Derm
 
Derm,

Have you looked here:


It contains some examples of code that creates ICO files from icon resources. I'm not sure if that's exactly the same as what you need, but it might be worth exploring.

If you can create an ICO file, then you can use LOADPICTURE() to create an object that can be added to the ImageList.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike:

I tried the link that you suggested. I didn't have a subscription to that website, so I 'bought' the solution I needed. Now I just need to figure out how it works. Thanks for your interest.

On another note, I know this isn't the proper forum for this subject, and maybe someone could steer me to the right discussion group: I think the whole human-computer interface needs to be redesigned. Many unknowns and questions could be answered almost immediately if the hidden machinations of the operating system were made unhidden. Ideally, for me, these could be made by dispensing with the textual nature of programming, and replacing the constructs of it with mechanical analogues. The end result would be to represent a program, or o/s, as a working 3-D machine, with each component, and error, instantly visible and made obvious. Just thinking and wishing...

Thanks again,

Derm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top