如果你要在你的C#程序中控制Windows的任务栏,有两个Windows api 可以帮到你!他们就是 FindWindowA 和 ShowWindow C#中声明如下: using System.Runtime.InteropServices; [DllImport(“user32.dll”, EntryPoint = “FindWindowA”)] [DllImport(“user32.dll”, EntryPoint = “ShowWindow”)] 其实Windows的任务栏就是一个特殊的窗口,所以操作窗口的方法,对任务栏一样适合!控制代码如下: //获取任务栏 //显示任务栏 //隐藏任务栏
public static extern IntPtr FindWindowA(string lp1, string lp2);
public static extern IntPtr ShowWindow(IntPtr hWnd, int _value);
IntPtr hTray = Form1.FindWindowA(“Shell_TrayWnd”, String.Empty);
Form1.ShowWindow(hTray, 5);
Form1.ShowWindow(hTray, 0);
通过win32api让c#控制windows任务栏_c#应用
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 通过win32api让c#控制windows任务栏_c#应用
相关推荐
- 暂无文章
