1、变量定义
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);
2、事件 隐藏
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);//隐藏系统任务栏
ShowWindow(FindWindow("Button", null), SW_HIDE);//隐藏系统开始菜单栏按钮
3、事件 显示
ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);//显示系统任务栏
ShowWindow(FindWindow("Button", null), SW_RESTORE);//显示系统开始菜单栏按钮