"Lock Computer" under Windows XP professional

hi,My Swing app needs to be notified when a user "Locks" the computer using CTRL+ALT+DEL combination and then clicking the "Lock Computer" button. I need to know even if the computer gets automatically locked via the screen saver. Can I do this at all ?
[274 byte] By [popuria] at [2007-10-1 23:48:10]
# 1
Why do you need to know that?
kajbja at 2007-7-15 15:39:10 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

I don't know a whole lot on the topic, but I imagine that if there was a solution, you're looking at using native code. Windows generates events that should be accessible from languages like C if you know how to find them, but I don't know if it will generate any specific events when the computer is locked

guitar_man_Fa at 2007-7-15 15:39:10 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Sorry, to clarify my previous answer, this question really isn't about java native methods, but rather, about the different language you use to execute the message. If you're using, say, C++, I would drop this question on a C++ forum.- Adam
guitar_man_Fa at 2007-7-15 15:39:10 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

You would need [url=http://java.sun.com/docs/books/tutorial/native1.1/index.html]JNI[/url].

[url=https://jdic.dev.java.net]JDIC [/url] has an incubator project, SystemInfo, this has a [url=https://jdic.dev.java.net/source/browse/jdic/src/incubator/systeminfo/src/share/classes/org/jdesktop/jdic/systeminfo/SystemInfo.java?rev=1.4&view=markup]org.jdesktop.jdic.systeminfo.SystemInfo

.isSessionLocked()[/url] you could poll.

To quote kajbj, why do you need to know that?

mlka at 2007-7-15 15:39:10 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5

hey thansk for those replies.. I will tell you why I need this..

I am writing a chat application for our LAN and ppl can set thrie status just as in Yahoo! Messenger or MSN.. status messages like "I am Busy" "Not at my desk" etc.

Now that Not At my Desk message got me thinking, all of us lock the computer when we leave the desk; so if I know this event, I can automatically set the status in the messenger. Otherwise its taking time for the users to get into the habit :)

Let me know if you have any other solution to this; sure I will take a look at the IBM project.

popuria at 2007-7-15 15:39:10 > top of Java-index,Java HotSpot Virtual Machine,Specifications...