winform显示、隐藏任务栏及开始菜单
标签:win ast dll str hide down button 隐藏 tor
private const int SW_HIDE = 0; //隐藏
private const int SW_RESTORE = 9;//显示
///
/// 获取窗体的句柄函数
///
/// 窗口类名
/// 窗口标题名
/// 返回句柄
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
///
/// 显示任务栏 && 开始菜单
///
public static void ShowTask()
{
//显示任务栏
ShowWindow((int)FindWindow("Shell_TrayWnd", null), SW_RESTORE);
//显示系统开始菜单栏按钮
ShowWindow((int)FindWindow("Button", null), SW_RESTORE);
}
///
/// 隐藏任务栏 && 开始菜单
///
public static void HideTask()
{
//隐藏任务栏
ShowWindow((int)FindWindow("Shell_TrayWnd", null), SW_HIDE);
//隐藏系统开始菜单栏按钮
ShowWindow((int)FindWindow("Button", null), SW_HIDE);
}
winform显示、隐藏任务栏及开始菜单
标签:win ast dll str hide down button 隐藏 tor
原文地址:https://www.cnblogs.com/teng-0802/p/11793025.html
评论