Is there a library that I can use with Java to listen for user logout and possibly other Windows events? (Even better if it supports multiple platforms!)
I remember reading about a library of this sort a number of years ago, but can't seem to find it now. I've seen other threads to do essentially the same thing using Python with win32ts.
Also better if it's free and/or open source.
Thanks.
Note: The candidate solution of using Runtime.getRuntime().addShutdownHook(Thread)
does not work correctly with javaw
. I am still looking for a solution that will work with javaw. See java bug ids 4486580 and 4302814. Thanks --cam