C# 隐藏任务栏

来源:互联网 发布:linux stat文件 编辑:程序博客网 时间:2024/05/26 17:48


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


if (trayHwnd != IntPtr.Zero) 
{  
    ShowWindow(trayHwnd, 0);
}

原创粉丝点击