现在的位置: 首页 > 综合 > 正文

Winform 如何防止双击标题栏、移动窗体

2013年10月09日 ⁄ 综合 ⁄ 共 291字 ⁄ 字号 评论关闭

         protected override void WndProc(ref Message m)
        {
            //拦截双击标题栏、移动窗体的系统消息
            if (m.Msg != 0xA3 && m.Msg != 0x0003 && m.WParam != (IntPtr)0xF012)
            {
                base.WndProc(ref m);
            }
        }

 

其中

m.Msg = 0xA3  ->  双击标题栏消息

m.Msg = 0x0003 && m.WParam = (IntPtr)0xF012  ->  移动窗体消息

抱歉!评论已关闭.