[DllImport("user32.dll")] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert); protected override void WndProc(ref Message m) { if (m.Msg == 0x112) { if (m.WParam.ToInt32() == 61539 || m.WParam.ToInt32() == 61587) { return; } } base.WndProc(ref m); }