如何捕获键盘仿真? [英] How to Capture a Keyboard Emulation?

查看:62
本文介绍了如何捕获键盘仿真?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用键盘仿真的读卡器.如果我打开记事本并刷卡,它会将卡上的数据打印到文件中.我在C#应用程序中编码时遇到了麻烦,该问题在于如何重点关注此事件以及如何将数据响应捕获到变量中.有帮助吗?我已经做了很多搜索,但并没有给出任何直接的答案.

I have a card reader that uses Keyboard Emulation. If I open notepad and swipe a card it prints to the file the data on the card. I am having trouble coding in my C# application with how to place focus on this event and capture the data response into a variable. Any Help? Ive done lots of searching and have not really given found any direct answers.

推荐答案

尝试使用Windows挂钩;从这里开始: http://msdn.microsoft.com/en-us /library/ms632589%28v=vs.85%29.aspx [
Try using Windows Hooks; start here: http://msdn.microsoft.com/en-us/library/ms632589%28v=vs.85%29.aspx[^].

To make a Window global, using P/Invoked SetWindowsHookEx in C# won''t be enough. You only can do it in native Windows DLL. You can use any compiler capable of producing native (unmanaged) Windows code like C++, Delp etc., but a mixed/mode (managed+unmanaged) project using C++/CLI has the benefit of using the same executable module to code setting up the hook and serving as a .NET assembly you can reference in your C# code. This way, you can catch any message in the system.

—SA


这篇关于如何捕获键盘仿真?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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