PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Thompson on September 05, 2010, 12:48:47 AM

Title: Icons in Menu
Post by: John Thompson on September 05, 2010, 12:48:47 AM
Is it possible to add icons to the top menu?

Thanks!
Title: Re: Icons in Menu
Post by: Rolf Brandt on September 05, 2010, 04:26:44 AM
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.

Title: Re: Icons in Menu
Post by: Rolf Brandt on September 05, 2010, 04:52:57 AM
Here is another source code example from Jose Roca's site:

http://www.jose.it-berater.org/smfforum/index.php?topic=1708.msg6029#msg6029
Title: Re: Icons in Menu
Post by: Rolf Brandt on September 05, 2010, 07:19:28 AM
... and here I added a small example FF3 project for bitmaps in menues:

http://www.planetsquires.com/protect/forum/index.php?topic=2661.0
Title: Re: Icons in Menu
Post by: John Thompson on September 07, 2010, 09:42:52 PM
Rolf,

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

Thanks again,

-John