public partial class Form1 : Form
{
private const int SW_HIDE = 0;
private const int SW_SHOW=5;
public Form1()
{
InitializeComponent();
}
[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 void butShow_Click(object sender, EventArgs e)
{
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_SHOW);
}
private void butHide_Click(object sender, EventArgs e)
{
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);
}
}
如何显示和隐藏任务栏
最新推荐文章于 2024-06-13 22:58:27 发布