c# 关闭 窗口最小化

来源:互联网 发布:ug8.5编程教程入门 编辑:程序博客网 时间:2024/06/07 09:01
protected override void WndProc(ref System.Windows.Forms.Message m)        {            const int wm_syscommand = 0x0112;            const int sc_close = 0xF060;            if (m.Msg == wm_syscommand && (int)m.WParam == sc_close)            {                this.WindowState = FormWindowState.Minimized;                return;            }            base.WndProc(ref m);        }