C#顯示及隱藏任務欄


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);

        /// <summary>
        /// 顯示任務欄
        /// </summary>
        public static void showtask()
        {
            ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);
        }
        /// <summary>
        /// 隱藏任務欄
        /// </summary>
        public static void Hidetask()
        {
            ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);
        }

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM