\r
~Menu() {\r
// TODO: Check whats happening if Menu was already destroyed by Win32 Window\r
- if( Win32.IsMenu( menuHandle_) != 0)\r
+ if (Win32.IsMenu( menuHandle_))\r
Win32.DestroyMenu( menuHandle_);\r
}\r
\r
return null;\r
}\r
\r
+ //\r
+ // Btw, this function is funky, it is being used by routines that are supposed\r
+ // to be passing an IntPtr to the AppendMenu function\r
+ //\r
internal virtual uint GetIDByMenuItem( MenuItem mi)\r
{\r
// FIXME: Pay attention, do not assign an id to a "stranger"\r
}\r
else {\r
Win32.AppendMenuA( parentMenu_.Handle, Win32.MF_ENABLED | Win32.MF_STRING,\r
- parentMenu_.GetIDByMenuItem(mi), mi.Text);\r
+ (IntPtr) parentMenu_.GetIDByMenuItem(mi), mi.Text);\r
}\r
}\r
}\r
{\r
if (value != StatusBarPanelAutoSize.None && value != StatusBarPanelAutoSize.Contents && value != StatusBarPanelAutoSize.Spring) {\r
\r
- throw new InvalidEnumArgumentException("System.Windows.Forms.StatusBarPanel::set_AutoSize(StatusBarPanelAutoSize) " +\r
- "value is not a valid StatusBarPanelAutoSize value");\r
+ throw new InvalidEnumArgumentException(\r
+ "System.Windows.Forms.StatusBarPanel::set_AutoSize(StatusBarPanelAutoSize) " +\r
+ "value is not a valid StatusBarPanelAutoSize value");\r
}\r
autoSize = value;\r
}\r
IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance,
ref object lpParam);
+ [DllImport ("user32.dll",
+ CallingConvention = CallingConvention.StdCall,
+ CharSet = CharSet.Auto)]
+ public static extern IntPtr CreateMenu ();
+
+ [DllImport ("user32.dll",
+ CallingConvention = CallingConvention.StdCall,
+ CharSet = CharSet.Ansi)]
+ public static extern bool AppendMenuA(IntPtr hMenu, uint uflags, IntPtr NewItem, string item);
+
+ [DllImport ("user32.dll",
+ CallingConvention = CallingConvention.StdCall)]
+ public static extern bool DestroyMenu (IntPtr hMenu);
+
[DllImport ("user32.dll", CallingConvention =
CallingConvention.StdCall, CharSet = CharSet.Auto)]
public extern static IntPtr DefWindowProcA (
CharSet = CharSet.Auto)]
public static extern bool IsWindowEnabled (IntPtr hWnd);
+ [DllImport ("user32.dll",
+ CallingConvention = CallingConvention.StdCall,
+ CharSet = CharSet.Auto)]
+ public static extern bool IsMenu (IntPtr hWnd);
+
+
[DllImport ("user32.dll",
CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Auto)]
public const int SS_RIGHTJUST = 0x00000400;
public const int SS_REALSIZEIMAGE = 0x00000800;
public const int SS_SUNKEN = 0x00001000;
+
+ public const int MF_ENABLED = 0;
+ public const int MF_STRING = 0;
+ public const int MF_POPUP = 0x10;
}
}
System.Windows.Forms/TabDrawMode.cs
System.Windows.Forms/TabPage.cs
System.Windows.Forms/TabSizeMode.cs
-System.Windows.Forms.Test/MenuTest.cs
System.Windows.Forms/TextBoxBase.cs
System.Windows.Forms/TextBox.cs
System.Windows.Forms/ThreadExceptionDialog.cs