C# 클래스 MouseKeyboardActivityMonitor.BaseHookListener

Base class used to implement mouse or keybord hook listeners. It provides base methods to subscribe and unsubscribe to hooks. Common processing, error handling and cleanup logic.
상속: IDisposable
파일 보기 프로젝트 열기: katopz/oskz-vcsharp

Private Properties

프로퍼티 타입 설명
CallNextHook int

공개 메소드들

메소드 설명
Dispose ( ) : void

Release delegates, unsubscribes from hooks.

Replace ( MouseKeyboardActivityMonitor.WinApi.Hooker hooker ) : void

Enables you to switch from application hooks to global hooks and vice versa on the fly without unsubscribing from events. Component remains enabled or disabled state after this call as it was before.

Start ( ) : void

Subscribes to the hook and starts firing events.

Stop ( ) : void

Unsubscribes from the hook and stops firing events.

보호된 메소드들

메소드 설명
BaseHookListener ( MouseKeyboardActivityMonitor.WinApi.Hooker hooker ) : System

Base constructor of BaseHookListener

Hooks are not active after instantiation. You need to use either BaseHookListener.Enabled property or call BaseHookListener.Start method.

Dispose ( bool isDisposing ) : void

Method to be used from Dispose and finalizer. Override this method to release subclass sepcific references.

GetHookId ( ) : int

Override to deliver correct id to be used for HookNativeMethods.SetWindowsHookEx call.

HookCallback ( int nCode, Int32 wParam, IntPtr lParam ) : int

A callback function which will be called every time a keyboard or mouse activity detected. WinApi.HookCallback

ProcessCallback ( int wParam, IntPtr lParam ) : bool

Override this method to modify logic of firing events.

비공개 메소드들

메소드 설명
CallNextHook ( int nCode, int wParam, IntPtr lParam ) : int

메소드 상세

BaseHookListener() 보호된 메소드

Base constructor of BaseHookListener
Hooks are not active after instantiation. You need to use either BaseHookListener.Enabled property or call BaseHookListener.Start method.
protected BaseHookListener ( MouseKeyboardActivityMonitor.WinApi.Hooker hooker ) : System
hooker MouseKeyboardActivityMonitor.WinApi.Hooker Depending on this parameter the listener hooks either application or global keyboard events.
리턴 System

Dispose() 공개 메소드

Release delegates, unsubscribes from hooks.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Method to be used from Dispose and finalizer. Override this method to release subclass sepcific references.
protected Dispose ( bool isDisposing ) : void
isDisposing bool
리턴 void

GetHookId() 보호된 추상적인 메소드

Override to deliver correct id to be used for HookNativeMethods.SetWindowsHookEx call.
protected abstract GetHookId ( ) : int
리턴 int

HookCallback() 보호된 메소드

A callback function which will be called every time a keyboard or mouse activity detected. WinApi.HookCallback
protected HookCallback ( int nCode, Int32 wParam, IntPtr lParam ) : int
nCode int
wParam System.Int32
lParam System.IntPtr
리턴 int

ProcessCallback() 보호된 추상적인 메소드

Override this method to modify logic of firing events.
protected abstract ProcessCallback ( int wParam, IntPtr lParam ) : bool
wParam int
lParam System.IntPtr
리턴 bool

Replace() 공개 메소드

Enables you to switch from application hooks to global hooks and vice versa on the fly without unsubscribing from events. Component remains enabled or disabled state after this call as it was before.
public Replace ( MouseKeyboardActivityMonitor.WinApi.Hooker hooker ) : void
hooker MouseKeyboardActivityMonitor.WinApi.Hooker An AppHooker or GlobalHooker object.
리턴 void

Start() 공개 메소드

Subscribes to the hook and starts firing events.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Unsubscribes from the hook and stops firing events.
public Stop ( ) : void
리턴 void