捕获和C#发送键盘/鼠标输入 [英] Capture and send keyboard / mouse input in C#

查看:208
本文介绍了捕获和C#发送键盘/鼠标输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方式来发送和无论什么样的应用程序具有焦点接收键盘信息。我记得在大学看到关于一个老的Windows API一个presentation,让你改变光标的位置,并发送正确的点击和这样的。

I am looking for a way to send and receive keyboard information regardless of what app has focus. I remember back in College seeing a presentation about an old Windows API that let you change the cursor position and send right clicks and such.

此外User32.dll中有没有办法使用.NET Framework做到这一点?

Besides User32.dll is there a way to do this with the .net framework?

推荐答案

据我所知,有没有办法捕捉到全球的键盘和放大器;鼠标事件。但也有它演示了同一个.NET类包装的创建上$ C $的CProject的几篇文章。

AFAIK, there's no way to capture the GLOBAL keyboard & mouse events. But there are a few articles on CodeProject which demonstrate the creation of .NET class wrappers for the same.

您可以在这里检查出来:

You can check them out here:

1)在C#中 处理全球鼠标和键盘钩子

1) Processing Global Mouse and Keyboard Hooks in C#

2)全球鼠标和键盘图书馆

编辑:顺便说一句,我创造了用1号库在C#中的小键盘记录器:)

BTW, I had created a SMALL keylogger in C# using the 1st library :)

这篇关于捕获和C#发送键盘/鼠标输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆