C# 控制系统任务栏的显示与隐藏

2023-05-30,,

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

C# 控制系统任务栏的显示与隐藏的相关教程结束。

《C# 控制系统任务栏的显示与隐藏.doc》

下载本文的Word格式文档,以方便收藏与打印。