> For the complete documentation index, see [llms.txt](https://pinvokeisalive.gitbook.io/pinvoke/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pinvokeisalive.gitbook.io/pinvoke/desktopfunctions/user32/getmenuiteminfo.md).

# GetMenuItemInfo

### C# Signature:

```cs
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern bool GetMenuItemInfo(IntPtr hMenu, UInt32 uItem, bool fByPosition, [In,Out] MENUITEMINFO lpmii);
```

### Notes:

```cs
public const UInt32 MF_BYCOMMAND  = 0x00000000;
public const UInt32 MF_BYPOSITION = 0x00000400;
```

### Sample Code:

```cs
MENUITEMINFO mif = new MENUITEMINFO(MIIM.STRING | MIIM.ID);
bool res = GetMenuItemInfo(hMenu, 0, true, mif);
if (res) {
     ++mif.cch;
     mif.dwTypeData = new String(' ', (int)mif.cch);
     res = GetMenuItemInfo(hMenu, 0, true, mif);
}
```
