winform显示、隐藏任务栏及开始菜单
2021-01-06 02:27
标签:void 任务 extern nbsp span tray hid int stat winform显示、隐藏任务栏及开始菜单 标签:void 任务 extern nbsp span tray hid int stat 原文地址:https://www.cnblogs.com/xinzheng/p/13180594.htmlprivate const int SW_HIDE = 0;
private const int SW_RESTORE = 9;
private const string SHELL_TRAYWND = "Shell_TrayWnd";
private const string BUTTON = "Button";
[DllImport("user32.dll")]
public static extern int ShowWindow(int hwnd, int nCmdShow);
[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
public static void ShowTask()
{
ShowWindow(FindWindow(SHELL_TRAYWND, null), SW_RESTORE);
ShowWindow(FindWindow(BUTTON, null), SW_RESTORE);
}
public static void HideTask()
{
ShowWindow(FindWindow(SHELL_TRAYWND, null), SW_HIDE);
ShowWindow(FindWindow(BUTTON, null), SW_HIDE);
}
文章标题:winform显示、隐藏任务栏及开始菜单
文章链接:http://soscw.com/index.php/essay/40378.html