• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to check if screen is locked in windows OS using java?  RSS feed

 
Raju Felix
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I've developed a java program which can capture the screenshots. But I don't want to take the screenshots while the screen is locked.
So, please help me, how to know programatically in java if the screen is locked.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch. You will probably have to resort to using the Windows API via JNI. What is the use case for taking screen shots without the user asking for it? Sounds a bit like surveillance :-)
 
Raju Felix
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou,
Actually, I have developed the code for using in my personal pc,
I have not worked with JNI and Windows API... Could you please provide some info. abt that?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javaworld.com/article/2076513/java-concurrency/enhance-your-java-application-with-java-native-interface--jni-.html and https://en.wikipedia.org/wiki/Java_Native_Interface came up in a quick search; there are many more introductions and tutorials if you search for them.

You probably will not get a whole lot of support for Windows API questions on a Java-oriented site :-)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!