C#获取任务栏位置代码
2012-08-09 11:32
176 查看
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("user32.dll")] public static extern int SystemParametersInfo(int uAction, int uParam, ref RECT re, int fuWinTni); [DllImport("SHELL32", CallingConvention = CallingConvention.StdCall)] public static extern uint SHAppBarMessage(int dwMessage, ref APPBARDATA pData); private void button1_Click(object sender, EventArgs e) { int aaa=0x00000005; APPBARDATA pdat=new APPBARDATA(); SHAppBarMessage(aaa,ref pdat); } } [StructLayout(LayoutKind.Sequential)] public struct APPBARDATA { public int cbSize; public IntPtr hWnd; public int uCallbackMessage; public int uEdge;//属性代表上、下、左、右 public RECT rc; public IntPtr lParam; } [StructLayout(LayoutKind.Sequential)] public struct RECT { public int left; public int top; public int right; public int bottom; public override string ToString() { return "{left=" + left.ToString() + ", " + "top=" + top.ToString() + ", " + "right=" + right.ToString() + ", " + "bottom=" + bottom.ToString() + "}"; } } }
相关文章推荐
- C#获取任务栏位置代码
- c# 获取当前代码所在位置(文件名以及所在行)
- 获取任务栏所在位置的代码
- 续【C#微信结合百度api获取当前用户的地理位置】代码详解
- asp.net(C#) 远程获取网页内容代码分享
- C# 怎样获取string的某个字符的位置和怎样获得某单词
- js获取元素相对窗口位置的实现代码
- C#下获取当前总毫秒数的方法和代码
- C#获取代码执行时间
- C# 脚本代码自动登录淘宝获取用户信息
- C# 如何获取鼠标在屏幕上的位置,不论程序是否为活动状态
- javascript 获取页面的高度及滚动条的位置的代码
- C# 获取光标在屏幕上的位置
- C#三行代码获取优酷首页热门视频集合
- arcgis二次开发时,c#代码实现鼠标点击地图时,获取地图的表的字段的信息
- C# 窗口最大化但不占用任务栏位置
- C#中获取文本框中光标所在位置
- C#获取鼠标位置,模拟鼠标,模拟键盘(多方转载)
- js与jquery中获取当前鼠标的x、y坐标位置的代码
- 在二次开发中怎么获取自己想要的那部分代码的位置