This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Java to capture OS related events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java to capture OS related events" Watch "Java to capture OS related events" New topic
Author

Java to capture OS related events

sanuji pillai
Greenhorn

Joined: Jul 05, 2010
Posts: 24
Hi,

I am looking for example code in java to capture OS related events like Logout/Login/Shutdown/Restart/Monitor-Lock ..etc.


Regards,

Sanuji Pillai.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

Yeah... you need native code for that. Google for a JNI or preferably a JNA solution to this problem.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7696
    
  20

sanuji pillai wrote:I am looking for example code in java to capture OS related events like Logout/Login/Shutdown/Restart/Monitor-Lock ..etc.

May I ask why? It goes against the entire ethos of Java, which is to be platform-independent.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
sanuji pillai
Greenhorn

Joined: Jul 05, 2010
Posts: 24
Thank You "Stephan van Hulst" & "Winston Gutkowski"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java to capture OS related events