aspose file tools*
The moose likes Java in General and the fly likes How to be notified when a user is using my application and locks their computer. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to be notified when a user is using my application and locks their computer." Watch "How to be notified when a user is using my application and locks their computer." New topic
Author

How to be notified when a user is using my application and locks their computer.

Andy Gertjejansen
Greenhorn

Joined: Dec 30, 2010
Posts: 16

I am building an application that needs to do some operations when a user locks their computers. How can I be notified of that? is there a system wide event or something I can catch? BTW I know how to do this on a windows OS but not Linux so just need to know about linux.

Thanks homies,
Andy


A+ 2009, OCPJP 6, (Working on: OCMJD 6)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

If this is available, and that's a big if, you would need JNI to get that event. I would first check MSDN to see if there is such an event.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Andy Gertjejansen
Greenhorn

Joined: Dec 30, 2010
Posts: 16

Thanks, I found a way to catch it on Windows systems which is but this application will need to catch the lock/unlock on Linux systems because the main user of this application works on a Linux system so I haven't been able to find anything but thanks for the reply.

Does any one know how to catch or be notified when a user locks there computer on a Linux system? it is a Java application .

Thanks partner,
Andy
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

There is not one single way to lock the computer on Linux. KDE probably does it differently from GNOME, which does it differently from Enlightenment, which does it differently from Blackbox. If I recall correctly, the latter doesn't even do it itself, it needs an external program for it.
Andy Gertjejansen
Greenhorn

Joined: Dec 30, 2010
Posts: 16

ahh, I suppose. The client uses Ubuntu I don't suppose that helps? He locks his computer ctrl + alt + L, but if the application does not have focus I cannot catch that. I will just have to do some more digging. Thanks for your help.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

Ubuntu uses GNOME by default but I believe users can still switch to KDE. (If not I guess they will need Kubuntu for that.)
Andy Gertjejansen
Greenhorn

Joined: Dec 30, 2010
Posts: 16

Interesting. I appreciate the help man.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to be notified when a user is using my application and locks their computer.