.net 中通过控制台启动调用已经存在的应用程序,如何隐藏控制台本身
.net 中通过控制台启动调用已经存在的应用程序,如何隐藏控制台本身?
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.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
联系我:holleyzh@126.com