PlanetSquires Forums

Support Forums => General Board => Topic started by: Rolf Brandt on September 05, 2010, 07:17:57 AM

Title: Menu with Bitmaps
Post by: Rolf Brandt on September 05, 2010, 07:17:57 AM
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