I am working on a Java Non-GUI Client which can capture Global hotkeys in windows OS and perform certain functionalities.
To achieve global hotkeys I have used Jintellitype And I have also worked on JNativeHook as a backup solution, in case something falls in first Library.
Now my requirement says that this should work even on Lock screen & Log-Off screen, as per my understanding an application can run in log-off screen only if it runs as windows service.
For Windows service I have used "Advanced Installer" & followed these steps.
Now when I run my application as windows service, it is not able to take the hotkeys. Same application if I run normally without being windows service it is able to take the hotkeys.
To verify if this is working or not, I am diverting all system.out to a file by following code:
public static PrintStream out;
try {
out = new PrintStream(new FileOutputStream("C:\\"+"output.txt"));
System.setOut(out);
} catch (FileNotFoundException ex) {
System.out.println(ex);
}
Questions:
- M I missing something here?
- Is this requirement not possible with windows?
- Is there any other approach or technology I should use to achieve this?