|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jniwrapper.win32.hook.Hook
public class Hook
This class enables to install various Windows hooks and retrieve information from them
using HookEventListener
.
Hook.Descriptor
class.
Nested Class Summary | |
---|---|
static class |
Hook.Descriptor
This class represents the enumeraton of available Windows hooks. |
Field Summary | |
---|---|
protected java.util.List |
_listeners
|
static Hook |
CALLWNDPROC
Hook described by Hook.Descriptor.CALLWNDPROC descriptor. |
static Hook |
CALLWNDPROCRET
Hook described by Hook.Descriptor.CALLWNDPROCRET descriptor. |
static CBTHook |
CBT
Hook described by Hook.Descriptor.CBT descriptor. |
static Hook |
FOREGROUNDIDLE
Hook described by Hook.Descriptor.FOREGROUNDIDLE descriptor. |
static Hook |
GETMESSAGE
Hook described by Hook.Descriptor.GETMESSAGE descriptor. |
static Hook |
JOURNALRECORD
Hook described by Hook.Descriptor.JOURNALRECORD descriptor. |
static Hook |
KEYBOARD
Hook described by Hook.Descriptor.KEYBOARD descriptor. |
static Hook |
KEYBOARD_LL
Hook described by Hook.Descriptor.KEYBOARD_LL descriptor. |
static Hook |
MOUSE
Hook described by Hook.Descriptor.MOUSE descriptor. |
static Hook |
MOUSE_LL
Hook described by Hook.Descriptor.MOUSE_LL descriptor. |
static Hook |
SHELL
Hook described by Hook.Descriptor.SHELL descriptor. |
static Hook |
SYSMSGFILTER
Hook described by Hook.Descriptor.SYSMSGFILTER descriptor. |
Method Summary | |
---|---|
void |
addListener(HookEventListener listener)
Adds a hook event listener. |
Hook.Descriptor |
getDescriptor()
Returns the descriptor of this hook. |
EventsFilter |
getFilter()
Returns a specified events filter of this hook. |
void |
install()
Installs the hook. |
boolean |
isInstalled()
Verifies if the hook is installed. |
boolean |
isSynchronous()
Returns the mode of this hook. |
protected void |
notifyListeners(HookEventObject event)
Notifies listeners about a hook event. |
void |
removeListener(HookEventListener listener)
Removes a hook event listener. |
void |
setFilter(EventsFilter filter)
Specifies events filter for this hook. |
void |
setSynchronous(boolean synchronous)
This method allows to swith between synchronous/asynchronous modes of the hook. Note: synchronous mode may significatly reduce the performance of the system, so use this mode carefully. |
void |
uninstall()
Uninstalls the hook. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.List _listeners
public static final Hook JOURNALRECORD
Hook.Descriptor.JOURNALRECORD
descriptor.
public static final Hook KEYBOARD
Hook.Descriptor.KEYBOARD
descriptor.
public static final Hook KEYBOARD_LL
Hook.Descriptor.KEYBOARD_LL
descriptor.
public static final Hook GETMESSAGE
Hook.Descriptor.GETMESSAGE
descriptor.
public static final Hook CALLWNDPROC
Hook.Descriptor.CALLWNDPROC
descriptor.
public static final CBTHook CBT
Hook.Descriptor.CBT
descriptor.
public static final Hook SYSMSGFILTER
Hook.Descriptor.SYSMSGFILTER
descriptor.
public static final Hook MOUSE
Hook.Descriptor.MOUSE
descriptor.
public static final Hook MOUSE_LL
Hook.Descriptor.MOUSE_LL
descriptor.
public static final Hook SHELL
Hook.Descriptor.SHELL
descriptor.
public static final Hook FOREGROUNDIDLE
Hook.Descriptor.FOREGROUNDIDLE
descriptor.
public static final Hook CALLWNDPROCRET
Hook.Descriptor.CALLWNDPROCRET
descriptor.
Method Detail |
---|
public Hook.Descriptor getDescriptor()
public boolean isInstalled()
public void addListener(HookEventListener listener)
listener
- a hook event listener.public void removeListener(HookEventListener listener)
listener
- a hook event listener.public void install()
public void uninstall()
protected void notifyListeners(HookEventObject event)
event
- event objectpublic boolean isSynchronous()
public void setSynchronous(boolean synchronous)
synchronous
- specifies the mode of the hook; if true then hook works in synchronous mode; false otherwise.public void setFilter(EventsFilter filter)
filter
- events filterpublic EventsFilter getFilter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |