[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
public static extern int ShowWindow(int hwnd,int nCmdShow);
private const int SW_HIDE = 0;
private const int SW_RESTORE = 9;
/// <summary>
/// 方法
/// </summary>
/// <param name="whether">是否显示</param>
public void HideorShow(bool whether)
{
if (whether == false)
{
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);//隐藏
}
else
{
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);//显示
}
}