3

I wrote an application in Java and it's purpose is to log the last time any user action has taken place.

When running this application logged in it works perfectly. But when I running it as a Windows Service it doesn't work because, from what I understand, it only captures the last user actions on Session0.

I want my application to get the last user input over all users logged in and even when no user is logged in. So if I move the mouse or press a key when logged out it will count towards the last user action. And if anyone is logged into the computer moves the mouse or presses a key this will count also.

I am currently using the approach described here that involves using JNA.

skaffman
  • 398,947
  • 96
  • 818
  • 769
  • Couldn't you run it as a _super_ user (i.e. administrator) and modify the code accordingly to collect all _other_ user interactions as well? You haven't posted any code so there's not much to go on here :) – Marvin Pinto Feb 10 '12 at 13:28
  • I basically using exactly what's here -> http://ochafik.com/blog/?p=98 – flippidippi Feb 10 '12 at 15:31
  • 1
    I'm not sure you're gonna be able to do this using a Windows service. As you've already discovered, Windows services are isolated for interaction to Session 0. Unless there's a way to hook into the lower kernel level, I'm not sure how anyone would do this. – Matt Davis Feb 11 '12 at 04:41
  • I've (somewhat) solved this problem by creating a screensaver that logs activity to a file. Then my java app reads the file when needed. My new problem lol -> http://stackoverflow.com/questions/9396479/allow-a-windows-screensaver-to-write-to-a-file-in-program-files – flippidippi Feb 22 '12 at 14:14
  • I don't know, but seems this task is better suited to .NET instead of Java? – Rosdi Kasim Aug 02 '12 at 05:11

0 Answers0