zoukankan      html  css  js  c++  java
  • C#winform窗体利用系统抓取关闭按钮事件


            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;
                }
                if (m.WParam.ToInt32() == SC_MAXIMIZE ) //是否点击最大化
                {
                   //.....................
                }
                if (m.WParam.ToInt32() == SC_CLOSE) //是否点击关闭
                {
                  //关闭时发生的事件
                }
              }
              base.WndProc(ref m);
            }

  • 相关阅读:
    LeetCode Subsets II
    LeetCode Rotate Image
    LeetCode Palidrome Number
    LeetCode Generate Parentheses
    LeetCode Maximum Subarray
    LeetCode Set Matrix Zeroes
    LeetCode Remove Nth Node From End of List
    Linux Loop设备 使用
    Linux 文件系统大小调整
    LeetCode N-Queens II
  • 原文地址:https://www.cnblogs.com/ziteng1807/p/10715011.html
Copyright © 2011-2022 走看看