LeVanPhuUIT / jnativehook

Automatically exported from code.google.com/p/jnativehook
0 stars 0 forks source link

GlobalScreen.isNativeHookRegistered() returns true momentarily if hooking fails #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Somehow create the situation in which creating the hook will fail (eg. 
creating manu hooks without unhooking)
2. execute this code:
    GlobalScreen.registerNativeHook();
    System.out.println(GlobalScreen.isNativeHookRegistered());
    System.out.println(GlobalScreen.isNativeHookRegistered());

This gives:
true
false

Should give:
false
false

What version of the product are you using? On what operating system?
Windows XP x64

Please provide any additional information below.

Getting this on stdout:

JNI_OnLoad(): GetEnv() successful.
RefreshLocaleList(): Received 4 locales.
RefreshLocaleList(): Loading layout for 0x0000000004090409: KBDUS.DLL.
RefreshLocaleList(): Loading layout for 0xFFFFFFFFF0010409: KBDUSX.DLL.
RefreshLocaleList(): Loading layout for 0xFFFFFFFFE0010411: Kbdjpn.dll.
RefreshLocaleList(): Loading layout for 0x0000000004110411: KBDJPN.DLL.
LoadUnicodeHelper(): RefreshLocaleList found 4.
GetAutoRepeatRate(): successful. (rate: 31)
GetAutoRepeatDelay(): successful. (delay: 1)
GetPointerAccelerationMultiplier(): successful. (multiplier: 0)
GetPointerAccelerationThreshold(): successful. (threshold: 0)
GetPointerSensitivity(): successful. (sensitivity: 10)
GetMultiClickTime(): successful. (time: 500)
JNI_Load(): JNI Loaded.
IsNativeThreadRunning(): State (0)
StartNativeThread(): start successful.
ThreadProc(): complete.
IsNativeThreadRunning(): State (1)
StartNativeThread(): initialization successful.
IsNativeThreadRunning(): State (0)

Getting this on stderr:
Couldn't create low-level hook.
RefreshLocaleList(): GetKeyboardLayoutList() found 4.
ThreadProc(): SetWindowsHookEx() failed!

Original issue reported on code.google.com by mark.jeronimus@gmail.com on 24 Jul 2013 at 12:14

GoogleCodeExporter commented 8 years ago
This is a bug in the thread start up blocking incorrectly on Windows.  Should 
be fixed in the trunk in the next couple of days.

Original comment by a...@1stleg.com on 9 Sep 2013 at 10:40

GoogleCodeExporter commented 8 years ago
Issue 65 has been merged into this issue.

Original comment by a...@1stleg.com on 9 Sep 2013 at 10:43

GoogleCodeExporter commented 8 years ago
Hello.  Any update on this fix?  Or is it already packaged into a new JAR?

Original comment by jpgoh...@gmail.com on 14 Oct 2013 at 6:04

GoogleCodeExporter commented 8 years ago
Not yet, I am having some hand/wrist problems that are seriously slowing me 
down at the moment.  Ill try to at least get a fix in the trunk tonight.

Original comment by a...@1stleg.com on 14 Oct 2013 at 9:32

GoogleCodeExporter commented 8 years ago
This should be addressed in version 1.2.  Will backport to 1.1.5 when I feel 
that the 1.2 code is stable.

Original comment by a...@1stleg.com on 19 Feb 2014 at 6:13

GoogleCodeExporter commented 8 years ago

Original comment by a...@1stleg.com on 2 Apr 2014 at 9:41