110,536
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[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)
{
Console.WriteLine(m.WParam);
return;
}
}
base.WndProc(ref m);
}
}
}
protected override CreateParams CreateParams
{
get
{
int CS_NOCLOSE = 0x200;
CreateParams parameters = base.CreateParams;
parameters.ClassStyle |= CS_NOCLOSE;
return parameters;
}
}