In Total Commander, how does one align the Help menu on the right of the menu bar? How does one use C?
Thank you for your guidance and finally found a solution.
[StructLayout (LayoutKind. Sequential)]
Public class MenuItemInfo
{
Public Int32 cbSize;
Public Int32 fMask;
Public Int32 fType;
Public Int32 fState;
Public Int32 wID;
Public IntPtr hSubMenu;
Public IntPtr hbmpChecked;
Public IntPtr hbmpUnchecked;
Public IntPtr dwItemData;
Public string dwTypeData;
Public Int32 cch;
}
[DllImport ("user32.dll", CharSet = CharSet. Auto)]
Public static extern bool GetMenuItemInfo (
HandleRef menuHandle,
Int32 itemIndex,
Bool byPosition,
[In, Out] MenuItemInfo menuItemInfo );
[DllImport ("user32.dll", CharSet = CharSet. Auto)]
Public static extern bool SetMenuItemInfo (
HandleRef menuHandle,
Int32 itemIndex,
Bool byPosition,
MenuItemInfo menuItemInfo );
Const Int32 MIIM_FTYPE = 0x00000100;
Const Int32 MFT_RIGHTJUSTIFY = 0x00004000;
Public static void RightJustifyMenuItem (MenuItem menuItem)
{
HandleRef menuHandle = new HandleRef (menuItem. Parent, menuItem. Parent. Handle );
MenuItemInfo menuItemInfo = new MenuItemInfo ();
MenuItemInfo. cbSize = Marshal. SizeOf (typeof (MenuItemInfo ));
MenuItemInfo. fMask = MIIM_FTYPE;
GetMenuItemInfo (menuHandle, menuItem. Index, true, menuItemInfo );