posts - 7,  comments - 0,  trackbacks - 0
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WinApi
{
    
public partial class Form1 : Form
    {
        
public Form1()
        {
            InitializeComponent();
        }

        [DllImport(
"user32.dll", EntryPoint = "FindWindowA")]
        
public static extern IntPtr FindWindowA(string lp1, string lp2);
        [DllImport(
"user32.dll", EntryPoint = "ShowWindow")]
        
public static extern IntPtr ShowWindow(IntPtr hWnd, int _value);
        
//获取任务栏
        IntPtr hTray = Form1.FindWindowA("Shell_TrayWnd", String.Empty);

        
private void btnShow_Click(object sender, EventArgs e)
        {
            ShowWindow(hTray,
1);
        }

        
private void btnHide_Click(object sender, EventArgs e)
        {
          ShowWindow(hTray, 
0);
        }
    }
}
posted on 2008-07-28 18:02 落雨凌风 阅读(39) 评论(0)  编辑 收藏 网摘 所属分类: C#

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

相关文章:

相关链接: