显示和隐藏系统任务栏的类

 1  public static class WinTask
 2     {
 3         private const int SW_HIDE = 0;//API参数表示隐藏窗口
 4         private const int SW_SHOW = 5;//API参数表示用当前的大小和位置显示窗口
 5
 6         [DllImport("user32.dll")]
 7         private static extern int FindWindow(string ClassName, string WindowName);
 8         [DllImport("user32.dll")]
 9         private static extern int ShowWindow(int handle, int cmdShow);
10        /// <summary>
11        /// 显示
12        /// </summary>
13         public static void ShowTaskBar()
14         {
15             ShowWindow(FindWindow("Shell_TrayWnd", null), SW_SHOW);
16         }
17        /// <summary>
18        /// 隐藏
19        /// </summary>
20         public static void HideTaskBar()
21         {
22             ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);
23         }
24     }

这样写完后任务栏是隐藏了,但是开始按钮还在,解决方案把任务栏设为自动隐藏就可以啦

时间: 2024-07-30 06:48:29

显示和隐藏系统任务栏的类的相关文章

C#显示及隐藏任务栏

private const int SW_HIDE = 0; //隐藏任务栏 private const int SW_RESTORE = 9;//显示任务栏 [DllImport("user32.dll")] public static extern int ShowWindow(int hwnd, int nCmdShow); [DllImport("user32.dll")] public static extern int FindWindow(string

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

private const int SW_HIDE = 0; //隐藏 private const int SW_RESTORE = 9;//显示 /// <summary> /// 获取窗体的句柄函数 /// </summary> /// <param name="lpClassName">窗口类名</param> /// <param name="lpWindowName">窗口标题名</para

隐藏系统任务栏

原文链接:http://blog.csdn.net/flyoxs/article/details/4171137 最简单的方法为: FindWindow("Shell_TrayWnd",NULL)->ShowWindow(SW_HIDE); 上面代码确能隐藏任务栏,但是,随便打开一个窗口最大化,原来任务栏的地方仍被空白占据着.调用Win32 API- SystemParametersInfo(SPI_SETWORKAREA),重新设置桌面工作区域,可解决这个问题,代码如下: vo

设置Mac自动显示和隐藏 Dock 栏的速度

Dock 显示和隐藏,系统默认设置成了1秒 通过终端.APP修改显示和隐藏的时间 (单位:秒) 默认的:   defaults write com.apple.dock autohide-delay -int 1 优化的:   defaults write com.apple.dock autohide-delay -int 0.8   defaults write com.apple.dock autohide-delay -int 0.6   defaults write com.apple

ios显示或隐藏导航栏的底线

根据产品需求要求把这个界面导航栏的底线去掉,下个控制器还需要有底线. 使用下面的代码实现 //在页面出现的时候就将黑线隐藏起来 -(void)viewWillAppear:(BOOL)animated { [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; [self.navigationController.navigation

Win10系统任务栏显示Cortana搜索框的设置方法

我们都知道Win10系统带有Cortana搜索功能,并且可以进行语音输入,要找文件或者软件程序非常的方便.那么怎么在任务栏上显示Cortana的搜索功能呢?下面就来介绍一下Cortana搜索功能怎么在任务栏上设置打开显示或者关闭. Win10任务栏上Cortana搜索设置打开显示或隐藏的方法 1.右键点击任务栏,找到"Cortana",会发现Cortana搜索功能是被默认隐藏的,我们只需要选择下面两个即可.2."显示Cortana图标"就是只有一个图标,"

iframe的滚动栏问题:显示/隐藏滚动栏

iframe 问题2008-01-22 16:37******   显示 iframe 内容 XHTML 1.0 Transitional 标准不能显示 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://ww

WinCE隐藏显示任务栏,当任务栏隐藏时将其显示,当任务栏显示时将其隐藏(FindWindow,ShowWindow,IsWindowVisible),

HANDLE hWndTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL); if(::IsWindowVisible(hWndTaskBar )==FALSE) { //假设任务栏隐藏,就把任务栏显示出来 ::ShowWindow(hWndTaskBar , SW_SHOWNORMAL); } Else { //假设任务栏显示,就把任务栏隐藏 ::ShowWindow(hWndTaskBar , SW_HIDE); } 申明:以上文字为&qu

UIScrollView UITableView 上拉隐藏导航栏和tabbar 下拉显示导航栏和tabbar

//UIScrollView  UITableView 上拉隐藏导航栏和tabbar 下拉显示导航栏和tabbar-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ CGPoint translation = [scrollView.panGestureRecognizer translationInView:scrollView.superview];    if