wpf 禁用window的systemmenu

        private IntPtr WidProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == 0x112)
            {
                if (wParam.ToInt32() == 0xF093)//单击打开菜单
                    handled = true;
                if (wParam.ToInt32() == 0xF100) //键盘打开菜单 
                    handled = true;
            }
            if (msg == 0xa4)
            {
                if (wParam.ToInt32() == 0x02) //非图标的非客户区
                    handled = true;
                if (wParam.ToInt32() == 0x03)//right key 图标
                    handled = true;
            }
            return IntPtr.Zero;
        }

 

posted @ 2019-06-05 16:59  马肯尼煤牙巴骨  阅读(327)  评论(0编辑  收藏  举报