【C#】隐藏和显示任务栏

Win32 API

[DllImport("user32.dll")]
private static extern int FindWindow(string ClassName, string WindowName);

[DllImport("user32.dll")]
private static extern int ShowWindow(int handle, int cmdShow);

private const int SW_HIDE = 0;//隐藏
private const int SW_SHOW = 5;//显示

使用

ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE); //隐藏任务栏

ShowWindow(FindWindow("Shell_TrayWnd", null), SW_SHOW); //显示任务栏

 

相关推荐
©️2020 CSDN 皮肤主题: 精致技术 设计师:CSDN官方博客 返回首页