zoukankan      html  css  js  c++  java
  • C#隐藏与显示系统任务栏和开始菜单栏按钮

    隐藏与显示系统任务栏和开始菜单栏按钮:
    直接上代码:
           private const int SW_HIDE = 0;  //隐藏
           private const int SW_RESTORE= 5;  //显示
     
           [DllImportAttribute("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 button3_Click(object sender, EventArgs e)  
            {  
                ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);//隐藏系统任务栏
                ShowWindow(FindWindow("Button", null), SW_HIDE);//隐藏系统开始菜单栏按钮
            }  
         //显示
            private void button2_Click(object sender, EventArgs e)  
            {  
                ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);//显示系统任务栏
                ShowWindow(FindWindow("Button", null), SW_RESTORE);//显示系统开始菜单栏按钮
            }


    说明:
    (1)引用了系统API函数,需要引用命名空间
             using System.Runtime.InteropServices;
    (2)ShowWindow()参数类型是一些int类型,可以查看MDNS
    也可以写成  
             ShowWindow(FindWindow("Shell_TrayWnd", null), 0); 

  • 相关阅读:
    Ubuntu 装JDK
    U盘文件夹被病毒隐藏,且不能取消解决办法
    wireshark: there are no interfaces on which a capture can be done
    [转]Ubuntu 常用快捷键10个
    恢复被win7覆盖的Ubuntu Grub
    U盘安装Win7 64位
    荣耀3X畅玩版狙击红米note!
    Secret and Whisper
    360 chrome不能登录Google账户
    周鸿祎仍想做手机
  • 原文地址:https://www.cnblogs.com/qiantao/p/9405141.html
Copyright © 2011-2022 走看看