GetMenuItemInfo (user32)
Last changed: NetMage-165.214.11.83

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool GetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition,
   ref MENUITEMINFO lpmii);

User-Defined Types:

None.

Notes:

[StructLayout(LayoutKind.Sequential)]
    public struct MENUITEMINFO
    {
        public uint cbSize;
        public uint fMask;
        public uint fType;
        public uint fState;
        public int wID;
        public int hSubMenu;
        public int hbmpChecked;
        public int hbmpUnchecked;
        public int dwItemData;
        public string dwTypeData;
        public uint cch;
        public int hbmpItem;
    }

// Values for the fMask parameter
//From winuser.h
const UInt32 MIM_MAXHEIGHT    =       0x00000001;
const UInt32 MIM_BACKGROUND   =       0x00000002;
const UInt32 MIM_HELPID       =       0x00000004;
const UInt32 MIM_MENUDATA     =       0x00000008;
const UInt32 MIM_STYLE    =       0x00000010;
const UInt32 MIM_APPLYTOSUBMENUS =    0x80000000;

Tips & Tricks:

Please add some!

Sample Code:

    MENUITEMINFO mif = new MENUITEMINFO();
         mif.cbSize = (uint)Marshal.SizeOf(typeof(MENUITEMINFO));
     mif.fMask = 0x10;
     mif.fType = 0;
     mif.dwTypeData = null;
     bool a = GetMenuItemInfo(hMenu, 0, true, ref mif);


Alternative Managed API:

Do you know one? Please contribute it!

Documentation