Menu with Bitmaps

Started by Rolf Brandt, September 05, 2010, 07:17:57 AM

Previous topic - Next topic

Rolf Brandt

Attached is a little FireFly Project with Bitmaps in Menues.
Uses original size and resized bitmaps.
Here is the function that does the job:


'--------------------------------------------------------------------------------
' MenuAddImage
' Assign a bitmap to a menuitem
' Example: MenuAddImage(HWND_FORM1_TOPMENU, IDC_FORM1_MNUOPENFILE, "IMAGE_RED13")
'--------------------------------------------------------------------------------
Function MenuAddImage(TopMenu As Dword, MenuItem As Dword, Bmp As Asciiz) As Long
   Local hBmp As Dword

   hBmp = LoadImage(app.hInstance, Bmp, %IMAGE_BITMAP, 13, 13, 0)
   SetMenuItemBitmaps(TopMenu, MenuItem, 0, hBmp, hBmp)
End Function


Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)