星空网 > 软件开发 > ASP.net

c# 控制台应用程序怎么隐藏黑窗口

class Program
    {
        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
        static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);
        [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
        static void Main(string[] args)
        {
            Console.Title = "WAHAHA";
            IntPtr intptr = FindWindow("ConsoleWindowClass""WAHAHA");
            if (intptr != IntPtr.Zero)
            {
                ShowWindow(intptr, 0);//隐藏这个窗口
            }
            string x;
            x = Console.ReadLine();
        }
    }
通过以上代码只能是让其闪的时间变得纪委短暂。有时候还是看到有框出现。
代码摘自网络




原标题:c# 控制台应用程序怎么隐藏黑窗口

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流