winform 船体最大化事件
2021-04-22 23:28
标签:sys win prot amp const proc his inf div winform 船体最大化事件 标签:sys win prot amp const proc his inf div 原文地址:http://www.cnblogs.com/kbqLibrary/p/8000178.htmlprotected override void WndProc(ref Message m)
{
FormWindowState previousWindowState = this.WindowState;
base.WndProc(ref m);
FormWindowState currentWindowState = this.WindowState;
if (previousWindowState != currentWindowState && currentWindowState == FormWindowState.Maximized)
{
// TODO: Do something the window has been maximized
}
}
const int WM_SYSCOMMAND = 0x112;
const int SC_CLOSE = 0xF060;
const int SC_MINIMIZE = 0xF020;
const int SC_MAXIMIZE = 0xF030;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam.ToInt32() == SC_MINIMIZE)
{
this.Visible = false;
return;
}
}
base.WndProc(ref m);
}//网上这个会出问题 应该是变量的问题