通过win32api让c#控制Windows任务栏
来源:互联网 发布:知乎 海天盛筵全部玩法 编辑:程序博客网 时间:2024/05/17 22:13
<script type="text/javascript"><!--google_ad_client = "pub-8218974082131540";google_ad_width = 120;google_ad_height = 240;google_ad_format = "120x240_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 如果你要在你的C#程序中控制Windows的任务栏,有两个Windows api 可以帮到你!他们就是 FindWindowA 和 ShowWindow
C#中声明如下:
using System.Runtime.InteropServices;
[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);
其实Windows的任务栏就是一个特殊的窗口,所以操作窗口的方法,对任务栏一样适合!控制代码如下:
//获取任务栏
IntPtr hTray = Form1.FindWindowA("Shell_TrayWnd", String.Empty);
//显示任务栏
Form1.ShowWindow(hTray, 5);
//隐藏任务栏
Form1.ShowWindow(hTray, 0);
- 通过win32api让c#控制Windows任务栏
- 通过win32api让c#控制Windows任务栏
- 通过win32api让c#控制Windows任务栏
- C#程序中控制Windows的任务栏
- 全面控制Windows任务栏
- Delphi 全面控制Windows任务栏
- c#隐藏/显示Windows任务栏
- 用 VC5 控制 Windows 任务栏图标
- C#引入Win32API:常用Win32API
- 通过API实现C#任务栏光标闪烁
- c#中添加Windows任务栏右键菜单
- 让Windows XP用上Windows 7的任务栏
- C#中使用Win32API
- C# 和 Win32API
- C# Win32API类
- C#調用WIN32API(轉)
- C# 和 Win32API
- 关于c#调用win32api
- Liferay Portal学习资料共享
- XMLHTTPRequest的属性和方法简介
- Hibernate配置文件中映射元素详解
- C# 检查字符串,防SQL注入攻击
- java程序性能优化
- 通过win32api让c#控制Windows任务栏
- DB_Menu
- OGRE 效果展示
- 使用C#开发一个简单的P2P应用
- 作为一个好的程序员,都需要具备哪些基本的素质和能力
- 解决SQLServer2000安装提示挂起的文件操作
- 创业故事:500元起家到月入19万
- 系统构架设计应考虑的因素
- 细节决定成败