Link to home
Start Free TrialLog in
Avatar of mkandre
mkandreFlag for United States of America

asked on

Windows Event Listener

If I run a java application as a windows service, how can I detect windows events such as "successful logon" by a user or "user logoff", etc. Specifically, what listener is employed and the specific event generated.
ASKER CERTIFIED SOLUTION
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mkandre

ASKER

I guess the first thing I need to do is find out how to run a java application as a windows service...An help there please.
SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mkandre

ASKER

How do i detect key events (key typed, key pressed, key released) without opening a window?
Unfortunately, to add a keyboard hook will require native code.
So again, code it in C/C++, then interface with your Java program using JNI.
Avatar of mkandre

ASKER

I could use some help in that direction: the "keyboard hook" and how to tie into the native code
We answered the Java part. For the C/ C++ code, you should ask in their respective TAs and not Java.
Avatar of mkandre

ASKER

>>> We answered the Java part. For the C/ C++ code, you should ask in their respective TAs and not Java

Actually, if u look at the actual original question, it says:

If I run a java application as a windows service, how can I detect windows events such as "successful logon" by a user or "user logoff", etc. Specifically, what listener is employed and the specific event generated.

That question or my subsequent queries haven't been successfully/suficently answered. Telling me go elsewhere and ask for an answer does not qualify as answer.
But you posted it in the Java TA. And in Java - the answer is that you can do this using JNI, but for the native code you need to ask in their respective TAs.
Avatar of mkandre

ASKER

Well I still disagree with your reasoning...but due to the fact that I think its best to avoid certain possibilities, I'm gonna close the question and award the points.

Thanks to all who participated.
And your reasoning is.....? You expect to get a C++ solution in the Java TA?
Maybe the points should've gone to only InteractiveMind