C# 클래스 ScreenToGif.Util.UserActivityHook

This class allows you to tap keyboard and mouse and / or to detect their activity even when an application runes in background or does not have any user interface at all. This class raises common .NET events with KeyEventArgs and MouseEventArgs so you can easily retrive any information you need.
파일 보기 프로젝트 열기: dbremner/ScreenToGif 1 사용 예제들

공개 메소드들

메소드 설명
Start ( ) : void

Installs both mouse and keyboard hooks and starts rasing events

Start ( bool installMouseHook, bool installKeyboardHook ) : void

Installs both or one of mouse and/or keyboard hooks and starts rasing events

Stop ( ) : void

Stops monitoring both mouse and keyboard events and rasing events.

Stop ( bool uninstallMouseHook, bool uninstallKeyboardHook, bool throwExceptions ) : void

Stops monitoring both or one of mouse and/or keyboard events and rasing events.

UserActivityHook ( ) : System

Creates an instance of UserActivityHook object and sets mouse and keyboard hooks.

UserActivityHook ( bool installMouseHook, bool installKeyboardHook ) : System

Creates an instance of UserActivityHook object and installs both or one of mouse and/or keyboard hooks and starts rasing events

To create an instance without installing hooks call new UserActivityHook(false, false)

비공개 메소드들

메소드 설명
CallNextHookEx ( int idHook, int nCode, int wParam, IntPtr lParam ) : int
GetKeyState ( int vKey ) : short
GetKeyboardState ( byte pbKeyState ) : int
KeyboardHookProc ( int nCode, Int32 wParam, IntPtr lParam ) : int

A callback function which will be called every time a keyboard activity detected.

MouseHookProc ( int nCode, int wParam, IntPtr lParam ) : int

A callback function which will be called every time a mouse activity detected.

SetWindowsHookEx ( int idHook, HookProc lpfn, IntPtr hMod, int dwThreadId ) : int
ToAscii ( int uVirtKey, int uScanCode, byte lpbKeyState, byte lpwTransKey, int fuState ) : int
UnhookWindowsHookEx ( int idHook ) : int

메소드 상세

Start() 공개 메소드

Installs both mouse and keyboard hooks and starts rasing events
Any windows problem.
public Start ( ) : void
리턴 void

Start() 공개 메소드

Installs both or one of mouse and/or keyboard hooks and starts rasing events
Any windows problem.
public Start ( bool installMouseHook, bool installKeyboardHook ) : void
installMouseHook bool true if mouse events must be monitored
installKeyboardHook bool true if keyboard events must be monitored
리턴 void

Stop() 공개 메소드

Stops monitoring both mouse and keyboard events and rasing events.
Any windows problem.
public Stop ( ) : void
리턴 void

Stop() 공개 메소드

Stops monitoring both or one of mouse and/or keyboard events and rasing events.
Any windows problem.
public Stop ( bool uninstallMouseHook, bool uninstallKeyboardHook, bool throwExceptions ) : void
uninstallMouseHook bool true if mouse hook must be uninstalled
uninstallKeyboardHook bool true if keyboard hook must be uninstalled
throwExceptions bool true if exceptions which occured during uninstalling must be thrown
리턴 void

UserActivityHook() 공개 메소드

Creates an instance of UserActivityHook object and sets mouse and keyboard hooks.
Any windows problem.
public UserActivityHook ( ) : System
리턴 System

UserActivityHook() 공개 메소드

Creates an instance of UserActivityHook object and installs both or one of mouse and/or keyboard hooks and starts rasing events
To create an instance without installing hooks call new UserActivityHook(false, false)
Any windows problem.
public UserActivityHook ( bool installMouseHook, bool installKeyboardHook ) : System
installMouseHook bool true if mouse events must be monitored
installKeyboardHook bool true if keyboard events must be monitored
리턴 System