Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12508573
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C#/.net

2015-03-31 17:04:37


  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Runtime.InteropServices;
  10. namespace TaskBar
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         [DllImport("user32.dll")]
  15.         public static extern int ShowWindow(int hwnd, int nCmdShow);
  16.          [DllImport("user32.dll")]
  17.         public static extern int FindWindow(string lpClassName,string lpWindowName);
  18.         //隐藏任务栏
  19.         private const int SW_HIDE = 0;
  20.         //显示任务栏
  21.         private const int SW_RESTORE = 9;
  22.         public Form1()
  23.         {
  24.             InitializeComponent();
  25.         }
  26.         private void show_Click(object sender, EventArgs e)
  27.         {
  28.             ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);
  29.         }
  30.         private void hide_Click(object sender, EventArgs e)
  31.         {
  32.             ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);
  33.         }
  34.     }
  35. }



image

G2{IBAPOZN_E1HC6V1R9()P

 

参考文献:

阅读(3042) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~