如何隐藏掉 控制台应用程序的运行窗口,让程序在后台运行

mingchou1990 2012-12-22 04:03:50
如题,有什么简单的方法??
...全文
470 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
mingchou1990 2012-12-27
  • 打赏
  • 举报
回复
引用 3 楼 sp1234 的回复:
在你的console程序中写 C# code?1234 [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)] private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow); ……
不懂用啊,怎么有两个代码呢?请指教
garfieldzf 2012-12-24
  • 打赏
  • 举报
回复
我没看到sp1234指导的、我没看到哦
cs张 2012-12-24
  • 打赏
  • 举报
回复
此乃“月黑风高夜杀人越货时”才用的,不要随便外传。
gengchenhui 2012-12-24
  • 打赏
  • 举报
回复
sp在教人“杀人越货”!。。。
  • 打赏
  • 举报
回复
此乃“月黑风高夜杀人越货时”才用的,不要随便外传。
  • 打赏
  • 举报
回复
在你的console程序中写
        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
        private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);
        [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
        private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
            Console.Title = Guid.NewGuid().ToString("n");
            var w = FindWindow("ConsoleWindowClass", Console.Title);
            if (w != IntPtr.Zero)
                ShowWindow(w, 0);
Assassin_ 2012-12-22
  • 打赏
  • 举报
回复
windows service
jiangshun 2012-12-22
  • 打赏
  • 举报
回复
windows服务

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧