Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
getmenuiteminfo (user32)
 
.
Summary

C# Signature:

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

User-Defined Types:

MENUITEMINFO

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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions