C#winform禁用双击图标关闭窗体的事件

xiaoxiao2025-04-21  18

        [DllImport("user32.dll")]         private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);         protected override void WndProc(ref Message m)         {             if (m.Msg == 0x112)             {                 if (m.WParam.ToInt32() == 61539 || m.WParam.ToInt32() == 61587)                 {                     return;                 }             }             base.WndProc(ref m);         }

转载请注明原文地址: https://www.6miu.com/read-5028787.html

最新回复(0)