How to make an application that can capture all click when you press the Enter key, but in my WinForm as well?(如何制作一个可以在按下 Enter 键时捕获所有点击的应用程序,但在我的 WinForm 中也是如此?)
问题描述
我尝试开发一个应用程序,该应用程序在所有鼠标单击时都制作屏幕截图,当我按下输入"键以制作教程时,但我看不到如何在我的应用程序之外捕获这些事件.我怎么能这样做???
i try to develop an application who make a screenshot all mouseclick and when i hit the key "enter" for make a tutorial, but i don't see how capture this events where they are outside of my application. How i can do that ???
推荐答案
使用这个项目 在 C# 中处理全局鼠标和键盘挂钩".我以前用过,我个人一直推荐它.
use this project "Processing Global Mouse and Keyboard Hooks in C#". I used it before and I personally always recommend it.
使用方法:
将 Gma.UserActivityMonitor dll 的引用添加到您的项目中.
add reference tot the Gma.UserActivityMonitor dll to your project.
using Gma.UserActivityMonitor.GlobalEventProvider;
_globalEventProvider1 = new Gma.UserActivityMonitor.GlobalEventProvider();
this._globalEventProvider1.KeyDown += HookKeyDown;//to listen to key down
this._globalEventProvider1.KeyUp += HookKeyUp;//to listen to key down
this.globalEventProvider1.MouseDown += HookMouseDown;//to listen to mouse down
this.globalEventProvider1.MouseUp += HookMouseUp;//to listen to mouse up
//and a lot more...
这篇关于如何制作一个可以在按下 Enter 键时捕获所有点击的应用程序,但在我的 WinForm 中也是如此?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何制作一个可以在按下 Enter 键时捕获所有点击的应用程序,但在我的 WinForm 中也是如此?
基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
