直接在form加入下面代码 更改switch里的判断
- public enum SysParam
- {
- MaxSize = 61488,
- MinSize = 61472,
- Close = 61536,
- Restore=61728,
- Top = 61443,
- Down = 61446,
- Left = 61441,
- Right = 61442,
- TitleClick = 61458,
- TitleDoubleClick = 61490,
- IconMenu=61587,
- TopLeft=61444,
- TopRight=61445,
- DownLeft=61447,
- DownRight=61448,
- ScroolX=61574,
- ScroolY=61559
- }
- /// <summary>
- /// 消息处理
- /// </summary>
- /// <param name="m"></param>
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == 0x0112) //系统消息
- {
- switch (m.WParam.ToInt32())
- {
- case (int)SysParam.Close:
- break;
- case (int)SysParam.MaxSize:
- break;
- case (int)SysParam.MinSize:
- break;
- case (int)SysParam.Restore:
- break;
- case (int)SysParam.Top:
- break;
- case (int)SysParam.Down:
- break;
- case (int)SysParam.Left:
- break;
- case (int)SysParam.Right:
- break;
- case (int)SysParam.TitleClick:
- break;
- case (int)SysParam.TitleDoubleClick:
- break;
- case (int)SysParam.IconMenu:
- break;
- case (int)SysParam.TopLeft:
- break;
- case (int)SysParam.TopRight:
- break;
- case (int)SysParam.DownLeft:
- break;
- case (int)SysParam.DownRight:
- break;
- case (int)SysParam.ScroolX:
- break;
- case (int)SysParam.ScroolY:
- break;
- default:
- listView1.Items.Add(m.WParam.ToInt32().ToString());
- break;
- }
- }
- base.WndProc(ref m);
- }