资源简介
1.实现了SPY++的核心功能,获取窗口句柄、窗口标题、类型名等信息;
2.实现了高亮功能;

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using BIC_GDI;
namespace MySpy1
{
public partial class Form1 : Form
{
public class COMRECT
{
public int left;
public int top;
public int right;
public int bottom;
public COMRECT()
{
}
public COMRECT(int left int top int right int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
}
[DllImport(“user32.dll“ EntryPoint = “WindowFromPoint“)]//指定坐标处窗体句柄
public static extern IntPtr WindowFromPoint(int xPoint int yPoint);
[DllImport(“user32.dll“)]
public extern static int GetWindowText(IntPtr hWnd StringBuilder lpString int nMaxCount);
[DllImport(“user32.dll“ SetLastError = true CharSet = CharSet.Auto)]
public static extern int GetClassName(IntPtr hWnd StringBuilder lpClassName int nMaxCount);
[DllImport(“user32.dll“)]
private static extern int GetWindowRect(IntPtr hwnd ref Rectangle lpRect);
[DllImport(“User32.dll“)]
private static extern IntPtr GetWindowDC(IntPtr hwnd);
[DllImport(“user32.dll“ CharSet = CharSet.Auto ExactSpelling = true)]
public static extern bool RedrawWindow(IntPtr hwnd COMRECT rcUpdate IntPtr hrgnUpdate int flags);
[DllImport(“user32.dll“ CharSet = CharSet.Auto ExactSpelling = true)]
public static extern bool UpdateWindow(IntPtr hWnd);
[DllImport(“user32.dll“ CharSet = CharSet.Auto ExactSpelling = true)]
public static extern bool InvalidateRect(IntPtr hWnd COMRECT rect bool erase);
private IntPtr OldWnd;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
timer1.Enabled = !timer1.Enabled;
if (timer1.Enabled)
{
button1.Text = “Stop“;
}
else
{
button1.Text = “Start“;
}
}
private void timer1_Tick(object sender EventArgs e)
{
IntPtr hWnd = WindowFromPoint(Cursor.Position.X Cursor.Position.Y);
// IntPtr hWnd =Win32.WindowFromPoint(Cursor.Position);
if (OldWnd != IntPtr.Zero && OldWnd != hWnd)
{
Refresh(OldWnd); //erase old window
}
if (hWnd == IntPtr.Zero)
{
textBox1.Text = null;
textBox2.Text = null;
textBo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12800 2013-08-02 18:27 MySpy1\bin\Debug\MySpy1.exe
文件 28160 2013-08-02 18:27 MySpy1\bin\Debug\MySpy1.pdb
文件 11592 2013-08-02 18:28 MySpy1\bin\Debug\MySpy1.vshost.exe
文件 32768 2007-03-04 07:43 MySpy1\bin\Debug\Win32GDI.dll
文件 6516 2013-08-02 18:27 MySpy1\Form1.cs
文件 7251 2013-08-02 17:19 MySpy1\Form1.Designer.cs
文件 6008 2013-08-02 17:19 MySpy1\Form1.resx
文件 3802 2013-08-02 16:35 MySpy1\MySpy1.csproj
文件 74 2013-08-02 16:32 MySpy1\MySpy1.csproj.user
文件 901 2013-08-02 16:32 MySpy1\MySpy1.sln
..A..H. 13824 2013-08-02 18:36 MySpy1\MySpy1.suo
文件 421 2013-08-02 18:28 MySpy1\obj\Debug\MySpy1.csproj.FileListAbsolute.txt
文件 847 2013-08-02 17:19 MySpy1\obj\Debug\MySpy1.csproj.GenerateResource.Cache
文件 12800 2013-08-02 18:27 MySpy1\obj\Debug\MySpy1.exe
文件 180 2013-08-02 17:19 MySpy1\obj\Debug\MySpy1.Form1.resources
文件 28160 2013-08-02 18:27 MySpy1\obj\Debug\MySpy1.pdb
文件 180 2013-08-02 16:35 MySpy1\obj\Debug\MySpy1.Properties.Resources.resources
文件 3748 2013-08-02 16:35 MySpy1\obj\Debug\ResolveAssemblyReference.cache
文件 487 2013-08-02 16:32 MySpy1\Program.cs
文件 1368 2013-08-02 16:32 MySpy1\Properties\AssemblyInfo.cs
文件 2862 2013-08-02 16:32 MySpy1\Properties\Resources.Designer.cs
文件 5612 2013-08-02 16:32 MySpy1\Properties\Resources.resx
文件 1091 2013-08-02 16:32 MySpy1\Properties\Settings.Designer.cs
文件 249 2013-08-02 16:32 MySpy1\Properties\Settings.settings
目录 0 2013-08-02 16:32 MySpy1\obj\Debug\TempPE
目录 0 2013-08-02 16:35 MySpy1\bin\Debug
目录 0 2013-08-02 16:32 MySpy1\bin\Release
目录 0 2013-08-02 18:27 MySpy1\obj\Debug
目录 0 2013-08-02 16:32 MySpy1\obj\Release
目录 0 2013-08-02 16:32 MySpy1\bin
............此处省略6个文件信息
- 上一篇:asp.net留言板源码+设计说明
- 下一篇:C#+SQL Server工资管理系统
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论