hi,
ich möchte bei meiner native Statusbar auch Icons verwenden.
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
leider werden keine Bitmaps (hBitmap) akzeptiert sonder nur hIcon
Ich habe es auch o:getIPicture()/o:getProperty(0) probiert aber auch das funktioniert nicht
bei XbpIcon() gibt es ja o:getBitmap() aber für XbpBitmap() gibt es kein o:GetIcon() ... oder ?
Icon aus Bitmap ? [erledigt]
Moderator: Moderatoren
- AUGE_OHR
- Marvin
- Beiträge: 12906
- Registriert: Do, 16. Mär 2006 7:55
- Wohnort: Hamburg
- Hat sich bedankt: 19 Mal
- Danksagung erhalten: 45 Mal
Re: Icon aus Bitmap ?
so ich habe es nun über die ImageList gelöst
Code: Alles auswählen
//
// create hBitmap
//
hBitmap := @user32:LoadImageA( hWnd,;
MAKEINTRESOURCE(xImage),;
IMAGE_BITMAP,;
16,;
16,;
nOr( LR_SHARED ,LR_CREATEDIBSECTION, LR_LOADTRANSPARENT ))
//
// add to Imagelist
//
@comctl32:ImageList_Add( ;
::hImageList2 ,; // A handle to the image list.
hBitmap,0 ) // The handle to the icon or cursor that contains the bitmap and mask for the new image
//
// now delete hBitmap to free Memory
//
@GDI32:DeleteObject(hBitmap)
//
// last Image
//
nMax := @comctl32:ImageList_GetImageCount(::hImageList2)
//
// get hIcon from Imagelist (Zero-based)
//
hIcon := @comctl32:ImageList_GetIcon(::hImageList2,;
nMax-1,;
ILD_NORMAL )
//
// create new Icon from hIcon
//
oIcon := XbpIcon():new():create()
oIcon:Handle := hIcon
oIcon:GetIconInfo()
//
// now we can use this Icon as oImage
//
oImage := oIcon
gruss by OHR
Jimmy
Jimmy