private int WM_SYSCOMMAND = 0x112;
private long SC_MAXIMIZE = 0xF030;
private long SC_MINIMIZE = 0xF020;
private long SC_CLOSE = 0xF060;
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam.ToInt64() == SC_MAXIMIZE)
{
MessageBox.Show("MAXIMIZE ");
//return;
}
if (m.WParam.ToInt64() == SC_MINIMIZE)
{
MessageBox.Show("MINIMIZE ");
//return;
}
if (m.WParam.ToInt64() == SC_CLOSE)
{
MessageBox.Show("CLOSE ");
//return;
}
}
base.WndProc(ref m);
}
C# Winform实现捕获窗体最小化、最大化、关闭按钮事件
最新推荐文章于 2024-05-29 19:43:56 发布