Information générale
Catégorie:
Fonctions Windows API
>>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 iPicture OLE interface. It has the following properties:
Handle, hPal, Type, Width, Height, CurDC, KeepOriginalFormat, Attributes
It has the following methods:
Render(), SelectPicture() PictureChanged(), SaveAsFile()
So, to have the handle of loaded picture:
oObj=LoadPicture(...)
?oObj.Handle
That's all!
bb
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement