winforms全屏

    技术2022-05-11  55

     static class Program    {        [DllImport("user32.dll", EntryPoint = "FindWindow")]       //DllImport是就是调用系统的api?        public static extern IntPtr FindWindow(            string lpClassName,            string lpWindowName        );        [DllImport("user32.dll", EntryPoint = "ShowWindow")]        public static extern int ShowWindow(            IntPtr hwnd,            int nCmdShow        );        public const int SW_HIDE = 0;        public const int SW_SHOW = 5;        /// <summary>        /// 应用程序的主入口点。        /// </summary>        [STAThread]        static void Main()        {            IntPtr hTaskBar = FindWindow("Shell_TrayWnd", "");            ShowWindow(hTaskBar, SW_HIDE);            Application.EnableVisualStyles();            Application.SetCompatibleTextRenderingDefault(false);            Application.Run(new Form1());            ShowWindow(hTaskBar, SW_SHOW);        }    }


    最新回复(0)