General information
Category:
Windows API functions
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only