How to Implement the right-aligned effect of the Help menu in Total Commander on the menu bar

Source: Internet
Author: User

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.