feiyucha

实现效果:

  

知识运用:

  API函数FindWindowShowWindow

实现代码:

        private const int SW_HIDE = 0;
        private const int SW_RESTORE = 9;
        [DllImport("user32.dll")]           //寻找窗口列表中第一个符合指定条件的顶级窗口
        public static extern int FindWindow(string IpClassName,string IpWindowName);
        [DllImport("user32.dll")]           //控制窗口的可见性
        public static extern int ShowWindow(int hwnd,int nCmdShow);
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
                ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE); //隐藏任务栏
            else
                ShowWindow(FindWindow("Shell_TrayWnd",null),SW_RESTORE);//显示任务栏
        }

  

分类:

技术点:

相关文章:

  • 2021-12-23
  • 2021-12-13
  • 2021-11-20
  • 2022-02-09
  • 2022-01-06
  • 2022-01-01
  • 2021-12-23
  • 2021-11-30
猜你喜欢
  • 2021-12-23
  • 2021-12-25
  • 2021-11-30
  • 2021-12-25
  • 2021-11-11
  • 2021-12-02
  • 2022-01-02
相关资源
相似解决方案