Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract Associated Icon to a Treeview
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00668799
Message ID:
00669436
Views:
28
hIcon remains 0 after the call to ExtractIconEX(). I have tried different files with the same result.

>>It seems that the OleCreatePictureIndirect(@PictDesc, @iid, 1, @IPic) which I assume will populate the IPic reference variable is null after the call. The PictDesc variable seems to contain a few high ascii characters. If I can't get the icon into a treeview control via the imagelist, is there an easy way to simply draw the icon elsewhere, like in a picture control?
>
>First, are you getting an icon handle back from ExtractIconEx()?
>
>Second, yes, but it's not very stable. You'd pass the icon to DrawIcon(). Unfortunately, because VFP doesn't "know" about the image, it's tough to keep it correctly updated.
>
>Third, as I said, I've used Alexander's code as a basis for my own work (creating an icon file from an icon handle). So, I know it does work. I'm going to take a look at your previous post again to see if there's something that I've over looked.
>
>>
>>
>>>>I am still trying to get the basics working. Even using the posted code, I am getting nowhere. At least this is not generating the C00000005 errors.
>>>>What am I missing? I am passing the file path, the icon index, and a reference to the imagelist.
>>>
>>>I'm having some of my own troubles here as well. I can and have been able to use Alexander's code to create icon files from the handle. However, I've been playing around with populating a ImageList, which seems to work fine. The problem is in associating the ImageList with a ListView. Don't know whether or not it's me or something to do with the nature of the image created. Is this where you're having problems too?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform