只能通过全局hook来做。http://dev.csdn.net/develop/article/42/42588.shtm
http://dev.csdn.net/develop/article/53/53147.shtm
这两篇文章不错,你自己看完后就应该知道怎么写了。既然对API不熟悉就先看:
http://dev.csdn.net/develop/article/52/52486.shtm
http://dev.csdn.net/develop/article/53/53147.shtm
这两篇文章不错,你自己看完后就应该知道怎么写了。既然对API不熟悉就先看:
http://dev.csdn.net/develop/article/52/52486.shtm
解决方案 »
- 大神求教。如何实现窗体打开一个数据库文件,并将这个数据库中的数据转化为XML语言存储起来。
- VS 2010 C#累加并行
- 强类型的DataSet更新主从表的事物应该怎么写呢?
- wpf中 textbox输入怎么隐藏
- 求一个两表合一的sql语句
- 一个简单的问题,在线等
- 设计一个windows应用程序,在该程序中定义一个学生类和一个班级类,以处理每个学生的学号、姓名、语文、英语、数学成绩。
- 在datagrid中如何加入RadioButtonList控件,并且能够写到数据库中
- web客户端 js添加快捷方式 兼容不了浏览器
- C# 指定转换无效
- datagrid中列的数据格式限定表达式如何写 ,数值类型的,比如数值类型需要保留2为小数?
- 如何在c#中使用excel
拿去参考一下,如果用hook ,你都能截获啦,有点太麻烦 !using System.Reflection;[DllImport("user32.dll", EntryPoint="FindWindow")]
public static extern int FindWindow (
string lpClassName,
string lpWindowName
);[DllImport("user32.dll", EntryPoint="FindWindowEx")]
public static extern int FindWindowEx (
int hWnd1,
int hWnd2,
string lpsz1,
string lpsz2
);[DllImport("user32.dll", EntryPoint="SendMessage")]
public static extern int SendMessage (
int hwnd,
int wMsg,
int wParam,
System.Text.StringBuilder lParam
);private void button1_Click(object sender, System.EventArgs e)
{
int hwnd = FindWindow("notepad", null);
hwnd = FindWindowEx(hwnd, 0, "Edit", null);
System.Text.StringBuilder str = new System.Text.StringBuilder(255);
SendMessage(hwnd, 0xD, str.Capacity, str);
MessageBox.Show(str.ToString());
}