//引入Windows API 的声明
[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);
IntPtr trayHwnd = FindWindow("Shell_TrayWnd", null);
if (trayHwnd != IntPtr.Zero) { ShowWindow(trayHwnd, 0);
}出处:真有意思网(http://www.zu14.cn)


浙公网安备 33010602011771号