C#显示及隐藏任务栏

2021-07-09 23:12

阅读:503

标签:res   port   rest   user   .dll   显示   ext   win   task   

private const int SW_HIDE = 0; //隐藏任务栏
        private const int SW_RESTORE = 9;//显示任务栏

        [DllImport("user32.dll")]
        public static extern int ShowWindow(int hwnd, int nCmdShow);
        [DllImport("user32.dll")]
        public static extern int FindWindow(string lpClassName, string lpWindowName);

        /// 
        /// 显示任务栏
        /// 
        public static void showtask()
        {
            ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);
        }
        /// 
        /// 隐藏任务栏
        /// 
        public static void Hidetask()
        {
            ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);
        }

  

C#显示及隐藏任务栏

标签:res   port   rest   user   .dll   显示   ext   win   task   

原文地址:https://www.cnblogs.com/Hooper_he/p/9691495.html


评论


亲,登录后才可以留言!