问题
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 ???
回答1:
use this project "Processing Global Mouse and Keyboard Hooks in C#". I used it before and I personally always recommend it.
How to use it:
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...
回答2:
You need to have a look in to implementing windows hooks.
来源:https://stackoverflow.com/questions/6871023/how-to-make-an-application-that-can-capture-all-click-when-you-press-the-enter-k