码迷,mamicode.com
首页 > Windows程序 > 详细

C# Console 运行之后最新化状态栏

时间:2017-06-03 14:00:12      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:point   log   最新   dllimport   zcl   type   ram   隐藏   user   

static void Main(string[] args)
        {


            new ConsoleCtrl();

            Console.Read();
        }


    class ConsoleCtrl
    {
        [DllImport("User32.dll", EntryPoint = "FindWindow")]
        private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
        [DllImport("user32.dll", EntryPoint = "FindWindowEx")]   //找子窗体   
        private static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
        [DllImport("User32.dll", EntryPoint = "SendMessage")]   //用于发送信息给窗体   
        private static extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, string lParam);
        [DllImport("User32.dll", EntryPoint = "ShowWindow")]   //
        private static extern bool ShowWindow(IntPtr hWnd, int type);

        public ConsoleCtrl()
        {
            Console.Title = "个人工作平台";
            IntPtr ParenthWnd = new IntPtr(0);
            IntPtr et = new IntPtr(0);
            ParenthWnd = FindWindow(null, "个人工作平台");

            ShowWindow(ParenthWnd, 2);//隐藏本dos窗体, 0: 后台执行;1:正常启动;2:最小化到任务栏;3:最大化
        }
    }

 

C# Console 运行之后最新化状态栏

标签:point   log   最新   dllimport   zcl   type   ram   隐藏   user   

原文地址:http://www.cnblogs.com/yshyee/p/6937064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!