com.jniwrapper.win32.system
Class WinEventHook
java.lang.Object
com.jniwrapper.win32.system.WinEventHook
public class WinEventHook
- extends java.lang.Object
WinEventHook
class provides windows event hook functionality.
Nested Class Summary |
static class |
WinEventHook.WinEvent
WinEvents class contains windows events constants which used
in the WinEventHook class |
static class |
WinEventHook.WinEventFlag
WinEventFlag class specifies whether hook function contained in a DLL or not and events to skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WinEventHook
public WinEventHook()
setWinEventHook
public static int setWinEventHook(WinEventHook.WinEvent eventMin,
WinEventHook.WinEvent eventMax,
Handle dllModule,
HookFunction function,
int processID,
int threadID,
WinEventHook.WinEventFlag eventFlag)
- The
SetWinEventHook
function sets an event hook function for a range of events.
- Parameters:
eventMin
- - WinEvents constant with specifies the lowest event value of the range.eventMax
- - WinEvents constant with specifies the highest event value of the range.dllModule
- - handle to the DLL with the hook function.function
- - the event hook function. An instance of a class nested from the HookFunction.processID
- - the ID of the process from which the hook function receives events.threadID
- - the ID of the thread from which the hook function receives events.eventFlag
- - an instance of WinEventFlag
.
- Returns:
- identificator of this event hook, or 0 if function fails.
unhookWinEvent
public static boolean unhookWinEvent(int hookID)
- The
UnhookWinEvent
function removes specified event hook function.
- Parameters:
hookID
- - handle to the event hook.
- Returns:
- true is succed and false otherwise