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);
        private void button1_Click(object sender, EventArgs e)
        {
            ShowWindow(FindWindow("Shell_TrayWnd",null),SW_HIDE);
            //YinYiNiao's Blog
        }
        private void button2_Click(object sender, EventArgs e)
        {
            ShowWindow(FindWindow("Shell_TrayWnd",null),SW_RESTORE);
        }

你可能感兴趣的:(WPF/Winform)