C# 显示隐藏任务栏

来源:互联网 发布:栅格数据和矢量数据 编辑:程序博客网 时间:2024/05/22 02:14
  #region  显示隐藏任务栏
        [DllImport("user32.dll", EntryPoint = "FindWindowEx", SetLastError = true)]
        static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
        [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
        static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);
        //IntPtr trayHwnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Shell_TrayWnd", null);

        #endregion


调用

 //隐藏任务栏
                //if (trayHwnd != IntPtr.Zero)
                //{
                //    ShowWindow(trayHwnd, 0);
                //}