C# 隐藏任务栏

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

posted @ 2012-01-11 01:23  MXi4oyu  阅读(206)  评论(0编辑  收藏  举报