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# 控制台应用程序怎么隐藏黑窗口的更多相关文章

  1. 13.C语言隐藏黑窗口

    //预编译,linker链接,Windows模式 #pragma comment(linker,"/subsystem:\"windows\" /entry:\" ...

  2. 隐藏C语言黑窗口

    隐藏C语言程序运行的黑窗口,加入预编译命令: (预编译,Linker链接,windows模式,黑窗口是dos模式) #pragma comment(linker,"/subsystem:\& ...

  3. OpenGL学习笔记:Console工程下如何不显示控制台黑窗口只显示Windows窗口

    刚学习OpenGL,绘制图形的时候,如果不进行设置,运行的时候会先出现黑窗口再出现Windows窗口. 其实要去除控制台窗口非常简单,只需要修改工程设置,把子系统改成Windows,程序的入口点改成m ...

  4. Console工程下如何不显示控制台黑窗口只显示Windows窗口

    原文地址https://www.cnblogs.com/smiler/p/4575052.html OpenGL,绘制图形的时候,如果不进行设置,运行的时候会先出现黑窗口再出现Windows窗口. 其 ...

  5. c# 隐藏 控制台应用程序

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...

  6. SaltStack远程执行Windows job程序(黑窗口)填坑经过

    近期接到领导通知,要将公司内的所有Windows服务添加到自动发布系统中,由于这种服务很多,节点分布散乱,每次都是由开发主管手动替换(虽然他们自己开发了自动打包替换工具,但仍需要一台一台登陆到服务器上 ...

  7. 如何创建 C# 控制台应用程序

    [转] 如何:创建 C# 控制台应用程序 本主题旨在生成最简单形式的 C# 程序(控制台应用程序)熟悉 Visual Studio 2008 开发环境.由于控制台应用程序是在命令行执行其所有的输入和输 ...

  8. golang 通过exec Command启动的进程如何关闭的解决办法 以及隐藏黑色窗口

    golang 通过exec Command启动的进程如何关闭的解决办法 在用exec包调用的其他进程后如何关闭结束,可以使用context包的机制进行管理,context包的使用详见:https:// ...

  9. C#/.Net开发入门篇(2)——第一个控制台应用程序

    相信看了上一篇文章的小伙伴已经安装好自己的开发工具了VS了,这一篇文章就教大家怎么创建第一个应用程序. 下面大家跟着我的操作一起来创建自己的第一个应用程序吧 一.打开VS工具点击左上角的文件→新建→项 ...

随机推荐

  1. fieldOfView

    fieldOfView 属性 fieldOfView:Number 语言版本:  ActionScript 3.0 运行时版本:  Flash Player 10, AIR 1.5 为三维视野指定一个 ...

  2. day12:vcp考试

    Q221. An administrator is creating a new Platform Service Controller Password Policy with the follow ...

  3. How to Check if Linux (Ubuntu, Fedora Redhat, CentOS) is 32-bit or 64-bit

    The number of CPU instruction sets has kept growing, and likewise for the operating systems which ar ...

  4. 源代码安装grub-customizer

    wget https://launchpad.net/grub-customizer/5.0/5.0.6/+download/grub-customizer_5.0.6.tar.gztar zxvf ...

  5. linq to sql之like

    contains——like '%提交%' StartsWith—— like '条件%' EndWith——like '%条件'

  6. 通过ANT实现jmeter批量执行脚本、生成报告、发送邮件全套build.xml文件

    在开始通过ANT运行build.xml之前,有一步必须要做,那就是将JMeter所在目录下extras子目录里的ant-JMeter-1.1.1.jar复制到Ant所在目录lib子目录之下,这样Ant ...

  7. 使用Application Center Test (ACT)来做压力测试 【转】

    在我们完成了基于SPS2003的开发,实现了我们的具体应用以后,我们是不是就可以直接请用户来使用了呢?如果我这么做,那么有经验的开发人员一定会对此嗤之以鼻:居然连压力测试也不做!真是不想活了…… 呵呵 ...

  8. 【Log】logback的配置和使用(一)

    logback介绍 Logback是由log4j创始人设计的又一个开源日志组件.logback当前分成三个模块:logback-core,logback- classic和logback-access ...

  9. RESTful Web API 实践

    REST 概念来源 网络应用程序,分为前端和后端两个部分.当前的发展趋势,就是前端设备层出不穷(手机.平板.桌面电脑.其他专用设备...). 因此,必须有一种统一的机制,方便不同的前端设备与后端进行通 ...

  10. hdu-1069(dp)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069 题意:一群猴子,给出n块砖的长x宽y高z,用这些砖拼起的高度最高是多少, 要求底下的砖的长宽都要 ...