Working example of JNA mouse hook

Yep, here is the code… public class CWMouseHook { public final User32 USER32INST; public final Kernel32 KERNEL32INST; public CWMouseHook() { if(!Platform.isWindows()) { throw new UnsupportedOperationException(“Not supported on this platform.”); } USER32INST = User32.INSTANCE; KERNEL32INST = Kernel32.INSTANCE; mouseHook=hookTheMouse(); Native.setProtected(true); } public static LowLevelMouseProc mouseHook; public HHOOK hhk; public Thread thrd; public boolean threadFinish = true; public … Read more