嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 3 元微信扫码支付:3 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
用C#实现类似Microsoft Spy 的小程序
IntPtr handle = IntPtr.Zero;
private void timer_Tick(object sender, EventArgs e)
{
IntPtr nHdl = Win32.WindowFromPoint(Cursor.Position);
nHdl = Win32Help.FindChildWindow(nHdl, Cursor.Position);
if (handle != IntPtr.Zero && handle != nHdl) Win32Help.Refresh(handle);
handle = nHdl;
if (handle == IntPtr.Zero)
{
txtHdlDec.Text = null;
txtTitle.Text = null;
txtClass.Text = null;
txtRect.Text = null;
}
else
{
txtHdlDec.Text = handle.ToString();
StringBuilder strBuilder = new StringBuilder(128);
Win32.GetWindowText(handle, strBuilder, strBuilder.Capacity);
txtTitle.Text = strBuilder.ToString();
Win32.GetClassName(handle, strBuilder, strBuilder.Capacity);
txtClass.Text = strBuilder.ToString();
Win32.Rect rc = new Win32.Rect();
Win32.GetWindowRect(handle, ref rc);
txtRect.Text = string.Format("[{0}x{1},p({2},{3})],s[({4},{5})-({6},{7})]",
rc.Width, rc.Height, Cursor.Position.X - rc.left, Cursor.Position.Y - rc.top,
rc.left, rc.top, rc.right, rc.bottom);
Win32Help.Highlight(handle);
}
}