Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
MENUITEMINFO (Structures)
.
C# Signature:
[StructLayout(LayoutKind.Sequential)]
struct MENUITEMINFO {
public uint cbSize;
public uint fMask;
public uint fType;
public uint fState;
public uint wID;
public IntPtr hSubMenu;
public IntPtr hbmpChecked;
public IntPtr hbmpUnchecked;
public IntPtr dwItemData; <- ItemData is up! by haijer
public string dwTypeData;
public uint cch;
public IntPtr hbmpItem;
// return the size of the structure
public static uint sizeOf
{
get { return (uint)Marshal.SizeOf(typeof(MENUITEMINFO)); }
}
}
VB.Net Signature:
<StructLayout(LayoutKind.Sequential)> _
Public Structure MENUITEMINFO
Public cbSize As Integer
Public fMask As Integer
Public fType As Integer
Public fState As Integer
Public wID As Integer
Public hSubMenu As IntPtr
Public hbmpChecked As IntPtr
Public hbmpUnchecked As IntPtr
Public dwItemData As IntPtr
Public dwTypeData As String
Public cch As Integer
Public hbmpItem As IntPtr
End Structure
User-Defined Field Types:
None.
Notes:
The c# MENUITEMINFO struct above did not work for me and kept resulting in empty or 'separator' menu items when used in conjunction with InsertMenuItem. Using the following struct, everything seems to work fine:
[StructLayout(LayoutKind.Sequential)]
struct MENUITEMINFO
{
public uint cbSize;
public uint fMask;
public uint fType;
public uint fState;
public int wID;
public int /*HMENU*/ hSubMenu;
public int /*HBITMAP*/ hbmpChecked;
public int /*HBITMAP*/ hbmpUnchecked;
public int /*ULONG_PTR*/ dwItemData;
public String dwTypeData;
public uint cch;
public int /*HBITMAP*/ hbmpItem;
}
This won't work on a 64-bit platform, though, as far as I know. To work on a 64-bit platform, hSubMenu through dwItemData and hbmpItem should be IntPtr.
Click to read this page
5/16/2017 4:01:43 AM - anonymous
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.