/// <summary> /// 屏蔽Alt+F4 /// </summary> /// <param name="m">要处理的 Windows </param> protected override void WndProc(ref Message m) { const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (m.Msg == WM_SYSCOMMAND) { if (m.Msg == WM_SYSCOMMAND) { if ((m.WParam.ToInt32() & 0xFFF0) == SC_CLOSE && m.LParam.ToInt32() == 0) { return; } } } base.WndProc(ref m); }
时间: 2024-10-21 02:05:36