[StructLayout(LayoutKind.Sequential)]
struct MENUINFO {
public Int32 cbSize;
public Int32 fMask;
public Int32 dwStyle;
public Int32 cyMax;
public IntPtr hbrBack;
public Int32 dwContextHelpID;
public Int32 dwMenuData;
}
Private Structure MENUINFO
Dim cbSize As Int32
Dim fMask As Int32
Dim dwStyle As Int32
Dim cyMax As Int32
Dim hbrBack As IntPtr
Dim dwContextHelpID As Int32
Dim dwMenuData As Int32
Public Sub New(ByVal owner As Control)
cbSize = Marshal.SizeOf(GetType(MENUINFO))
End Sub
End Structure
None.
None.
MENUINFO mi = new MENUINFO();
mi.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(MENUINFO));
The above don't work on x64 Vista. This one does.
[StructLayout(LayoutKind.Sequential)]
public struct MENUINFO
{
public UInt32 cbSize;
public UInt32 fMask;
public UInt32 dwStyle;
public uint cyMax;
public IntPtr hbrBack;
public UInt32 dwContextHelpID;
public UIntPtr dwMenuData;
}