Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HIcon to ImageList
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00324431
Message ID:
00325091
Views:
29
>>Hi Ed,
>>
>>I think ExtractAssociatedIcon() does this without messing with the registry. The problem is how to use that with the treeview or listview. Unfortunately, neither of these controls will accept an icon handle as an image.
>
>As do ExtractIcon/ExtractIconEx, all of which seem to take the file name and image index number as a reference...hmmm, could it be that the magic needed here comes from the registry-carried information, to figure out what image we have asociated with a given file extension? maybe the info in the registry, rather than the easy-to-get hIcon is what is needed here; I'm not an icon user in my applications, so I haven't experimented extensively with the mechanisms needed for plotzing icons into these controls. What, if not an hIcon, do these things tajke for an image reference? Can't be just an icon file name, since that's an inadequate desciptor; I think that you can have at least 256 different, distinct icons (which can have multiple images implied, a largefonts and smallfonts enabled choice; it may be more like 16K distinct icons...) in a single file. The index value is a WORD, which is treated as a signed USHORT in reality, because of the special behavior associated wih a
>negative index reference.

Hiya Ed,

Have a good weekend?

I think I understand what you're getting at here now. You're suggesting that first we retrieve the application assosicated with the file in the registry by first retrieve the default under the entry under HKEY_CLASSES_ROOT (i.e. HKEY_CLASSES_ROOT\.xls = Excel.Sheet.8). Next, we take this information an open the default icon string under something like HKEY_CLASSES_ROOT\Excel.Sheet.8\DefaultIcon. This is usually in the form of "< fully qualified exe or dll filename >,1" where the number following the comma is the zero based offset of the iconresource. Then we have a filename (and some additional information) for the imagelist. Is this what you're getting at?

I don't know whether or not this will work. The only way to find out is to try it. Be pretty neat if it does.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform