码迷,mamicode.com
首页 > Windows程序 > 详细

winform显示、隐藏任务栏及开始菜单

时间:2020-06-23 10:27:19      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:void   任务   extern   nbsp   span   tray   hid   int   stat   

private 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显示、隐藏任务栏及开始菜单

标签:void   任务   extern   nbsp   span   tray   hid   int   stat   

原文地址:https://www.cnblogs.com/xinzheng/p/13180594.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!