zoukankan      html  css  js  c++  java
  • 【技术积累】【C#】Disable Windows窗体右上角的关闭按钮

    案例代码片段:

        public partial class Form1 : Form
        {
            [DllImport("USER32.dll")]
            public static extern int RemoveMenu(int hMenu, int nPosition, int wFlags);
    
            [DllImport("USER32.dll")]
            public static extern int GetSystemMenu(int hWnd, int bRevert);
    
            const int MF_REMOVE = 0x1000;
            const int SC_CLOSE = 0xF060;
    
            public Form1()
            {
                //do something
    
                int hMenu = GetSystemMenu(this.Handle.ToInt32(), 0);
                RemoveMenu(hMenu, SC_CLOSE, MF_REMOVE);
    
                //do something
            } 
        }
  • 相关阅读:
    HTML
    HTML
    HTML
    HTML
    HTML
    HTML
    HTML
    TOMCAT-IDEA远程debug方法
    调整mysql数据库最大连接数
    win10开机时内存使用率达到99%以上
  • 原文地址:https://www.cnblogs.com/lienhua34/p/2862023.html
Copyright © 2011-2022 走看看