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:
00325701
Views:
21
>>George,
>>
>> Read your August, 1998 Foxpro Advisor on icon related Windows API calls. Great article. Helped a lot. I mastered
>> your demo's in the article too.
>>
>> One thing it doesn't mention which I can't find anywhere is this: How do I get an icon handle (eg. from Extracticon) to
>> load into the MSComCtrl Imagelist (used by Treeview and Listview).
>>
>> Somehow, I need to go from hIcon (integer) to the same thing that would be returned by LoadPicture(file.ico) (object).
>> Even VB help on this is pretty sparse.
>>
>> I'd appreciate any advice you could give.
>>
>> Thanks
>
>Hi Craig,
>
>I think this question has come up before. Unfortunately, AFAIK, there's no way to do this. If you know what the icons are going to be beforehand, I'd recommend combining them into a single bitmap as using the Picture Clip control as a source for the images. It'll reduce the number of files that have to be loaded and thus speed up the process.


Dear George,

LoadPicture() picture function gives back an object reference, with the type of picture.

It is a iPictureDisp OLE interface. It has the following properties:

Handle, hPal, Type, Width, Height

So, to have the handle of loaded picture:

oObj=LoadPicture(...)
?oObj.Handle

That's all!

bb
Previous
Reply
Map
View

Click here to load this message in the networking platform