How to Right-Justify Menu Items in Windows 95Last reviewed: September 29, 1995Article ID: Q125675 |
The information in this article applies to:
SUMMARYIn Windows 95, right-justify (right-align) a menu item by using the MFT_RIGHTJUSTIFY type in MENUITEMINFOSTRUCTURE.
MORE INFORMATIONThere is a new menu type in Windows 95, MFT_RIGHTJUSTIFY type, which you can use to right justify a menu item. The Windows version 3.1 method of prefixing the string with "\a" or "\b" will no longer work. To right justify a menu item in Windows 95:
HMENU hMenu; MENUITEMINFO mii; char szBuffer [80]; hMenu = GetMenu (hwnd); // Get the original value of mii.fType first // and OR that with MFT_RIGHTJUSTIFY mii.cbSize = sizeof (MENUITEMINFO); mii.fMask = MIIM_TYPE; mii.dwTypeData= szBuffer; mii.cch = sizeof (szBuffer); GetMenuItemInfo(hMenu, 1, TRUE, &mii); // OR in MFT_RIGHTJUSTIFY type mii.fMask = MIIM_TYPE; mii.fType = mii.fType | MFT_RIGHTJUSTIFY; // Right justify the specified item and all those following it SetMenuItemInfo(hMenu, 1, TRUE, &mii); return 0; REFERENCESFor additional information on right justifying menus in Windows 3.1, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q67063 TITLE : Inserting Right Justified Text in a Menu in Windows |
Additional reference words: 4.00 alignment align
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |