Menu Bar Alignment

Started by Richard Kelly, November 27, 2011, 07:15:34 AM

Previous topic - Next topic

Richard Kelly

If you want to right align in a menu bar as I've seen "Help" right aligned many times, the following will do the trick.


Function MAIN_WM_CREATE ( _
                        hWndForm As Dword, _      ' handle of Form
                        ByVal UserData As Long _  ' optional user defined Long value
                        ) As Long

Local udtMenuItemInfo   As MENUITEMINFO

' Right align the menu Help item

    udtMenuItemInfo.cbsize = SizeOf(udtMenuItemInfo)
    udtMenuItemInfo.fmask = %MIIM_FTYPE
    GetMenuItemInfo (HWND_MAIN_TOPMENU, IDC_MAIN_MNUHELP, %FALSE, udtMenuItemInfo)
    udtMenuItemInfo.ftype = udtMenuItemInfo.ftype Or %MFT_RIGHTJUSTIFY
    SetMenuItemInfo (HWND_MAIN_TOPMENU, IDC_MAIN_MNUHELP, %FALSE, udtMenuItemInfo)


***Note posted to wrong forum :-[

Rick Kelly

Rolf Brandt

Thanks for that one, Rick. I remember spending quite some time on that years ago until I got it achieved in VB6.
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)

José Roca

Or you can call the AfxRightJustifyMenuItem wrapper function.

Richard Kelly

Quote from: Jose Roca on November 27, 2011, 01:02:04 PM
Or you can call the AfxRightJustifyMenuItem wrapper function.

I have to find or start a list of your functions. I've already spent several hours just opening up your *.inc files and browsing through them. I must have missed that one or, at my somewhat advanced age, the memory bank is just overloaded.....

Rick Kelly :o


David Kenny

Jose,

Both the 2.05 API headers and the help file downloaded as .PHP files.  I simply changed the extension to .RAR and was able to open and extract both.


José Roca

Quote
Both the 2.05 API headers and the help file downloaded as .PHP files.  I simply changed the extension to .RAR and was able to open and extract both.

It's a problem of FireFly 8. Try right clicking the link and using Save link as, or use another browser.

Haakon Birkeland

QuoteFireFly 8
I want that update too! 8oÞ
Haakon 8o)

José Roca


David Kenny

Well,  that's what I get for blindly clicking OK on an "update ready" message.  Sorry to bother you with a problem I caused myself.  :)