.net 中通过控制台启动调用已经存在的应用程序,如何隐藏控制台本身?
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
[DllImport("User32.dll", EntryPoint = "FindWindow")] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("User32.dll", EntryPoint = "ShowWindow")] // private static extern bool ShowWindow(IntPtr hWnd, int type); private static void HideWindow() { IntPtr ParenthWnd = FindWindow(null, Console.Title); ShowWindow(ParenthWnd, 0); //隐藏本dos窗体, 0: 后台执行;1:正常启动;2:最小化到任务栏;3:最大化 }
参考:http://www.cnblogs.com/pccai/archive/2011/03/08/1977692.html