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
Download Visual Studio Add-In

Search Results for "MENUITEMINFO" in [All]

user32

.

                MENUITEMINFO mii = new MENUITEMINFO();

.

                MENUITEMINFO sep = new MENUITEMINFO();

.

            MENUITEMINFO mii = new MENUITEMINFO();

.

    internal static extern bool InsertMenuItem(HMenu hmenu, uint uposition, uint uflags, ref MENUITEMINFO mii);

.
Summary
.

static extern bool GetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition, ref MENUITEMINFO lpmii);

.

MENUITEMINFO

.

public struct MENUITEMINFO

.

MENUITEMINFO mif = new MENUITEMINFO();

.

mif.cbSize = (uint)Marshal.SizeOf(typeof(MENUITEMINFO));

.

bool a = GetMenuItemInfo(hMenu, 0, true, ref mif);

.
Documentation
[GetMenuItemInfo] on MSDN
.

   [In] ref MENUITEMINFO lpmii);

.

   ByVal fByPosition As Boolean, ByRef lpmii As MENUITEMINFO) As Boolean

.
Summary
.

static extern bool SetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition,

.

   [In] ref MENUITEMINFO lpmii);

.

Public Declare Function SetMenuItemInfo Lib "user32" (ByVal hMenu As IntPtr, ByVal uItem As uint, ByVal fByPosition As Boolean, ByRef lpmii As MENUITEMINFO) As Boolean

.

It's very important to specify 'ref' on the MENUITEMINFO otherwise on Windows 7 32-bit user32.dll will crash with the error text 0a9e372d3b4ad19135b953a78882e789. However, Windows 8.1 64 bit it works with or without the 'ref' keyword. Tested both using NET40.

.
Documentation
[SetMenuItemInfo] on MSDN
.
Summary
.

static extern bool SetMenuItemInfo(IntPtr hMenu, uint uItem, bool fByPosition,

.

   [In] ref MENUITEMINFO lpmii);

.

Public Declare Function SetMenuItemInfo Lib "user32" (ByVal hMenu As IntPtr, ByVal uItem As uint, ByVal fByPosition As Boolean, ByRef lpmii As MENUITEMINFO) As Boolean

.
Documentation
[SetMenuItemInfo] on MSDN

Structures

. .
Summary
The MENUITEMINFO structure contains information about a menu item.
.

struct MENUITEMINFO {

.

     get { return (uint)Marshal.SizeOf(typeof(MENUITEMINFO)); }

.

Public Structure MENUITEMINFO

.
Documentation
[MENUITEMINFO] on MSDN

 
Access PInvoke.net directly from VS: