Icons in Menu

Started by John Thompson, September 05, 2010, 12:48:47 AM

Previous topic - Next topic

John Thompson

Is it possible to add icons to the top menu?

Thanks!

Rolf Brandt

#1
Here is a snippet from Gary Beene's website. (I did not try it.)

Function SetMenuIcon(FrmHwnd As Long, IconName As String, MainMenuNumber As Long, MenuItemNumber As Long, Flags As Long) As Long
On Error Resume Next
    Local MemIcon As ICONINFO
    Local lngMenu As Long, lngSubMenu As Long, lngMenuItemID As Long, hIcon As Long, hBmp&
    Local AsciizIcon As Asciiz * 100
    AsciizIcon = IconName
    hIcon = LoadIcon(GetModuleHandle(""), AsciizIcon)
    GetIconInfo hIcon, MemIcon
    hBmp = MemIcon.hBmColor
    lngMenu = GetMenu(FrmHwnd)
    lngSubMenu = GetSubMenu(lngMenu, MainMenuNumber)
    lngMenuItemID = GetMenuItemID(lngSubMenu, MenuItemNumber)
    Function = SetMenuItemBitmaps(lngMenu, lngMenuItemID, Flags, hBmp, hBmp)
End Function


Source: http://www.garybeene.com/power/code/gbsnippets_gbs_00434.htm

Make sure to read Gary's comments.

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)

Rolf Brandt

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)

Rolf Brandt

... and here I added a small example FF3 project for bitmaps in menues:

http://www.planetsquires.com/protect/forum/index.php?topic=2661.0
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)

John Thompson

Rolf,

Thank you very much!  I was afraid I was missing a FireFly-integrated way, but this is very easy.

Thanks again,

-John