首页 > 其他 > 详细

Hide/Show running Console

时间:2014-03-06 19:24:06      阅读:522      评论:0      收藏:0      [点我收藏+]

http://stackoverflow.com/questions/3571627/show-hide-the-console-window-of-a-c-sharp-console-application

using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

const int SW_HIDE = 0;
const int SW_SHOW = 5;

var handle = GetConsoleWindow();

// Hide
ShowWindow(handle, SW_HIDE);

// Show
ShowWindow(handle, SW_SHOW);

Hide/Show running Console,布布扣,bubuko.com

Hide/Show running Console

原文:http://www.cnblogs.com/sskset/p/3584198.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!