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:最大化
        }
    }

 

相关文章:

  • 2021-10-28
  • 2021-12-06
  • 2022-12-23
  • 2021-07-31
  • 2021-11-19
  • 2021-11-10
  • 2021-12-28
  • 2022-12-23
猜你喜欢
  • 2022-03-01
  • 2021-07-11
  • 2022-02-03
  • 2022-12-23
  • 2021-12-04
  • 2021-08-23
  • 2022-01-20
相关资源
相似解决方案