How to make an application that can capture all click when you press the Enter key, but in my WinForm as well?

后端 未结 2 385
太阳男子
太阳男子 2020-12-22 02:30

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 the

相关标签:
2条回答
  • 2020-12-22 03:09

    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...
    
    0 讨论(0)
  • 2020-12-22 03:17

    You need to have a look in to implementing windows hooks.

    0 讨论(0)
提交回复
热议问题