B4J Library jWin32IdleTime - Get user's idle time (Windows)

jmon

Well-Known Member
Licensed User
Hi,

This script is a B4J compiled version of this example : http://ochafik.com/blog/?p=98 by Olivier Chafik.
The library aims at retrieving the user's idle time using the Windows' GetLastInput Method. It could be useful in case of a chat program, or to stop certain actions when the user is not using your application.
The library as been implemented using JNA, but works only with JNA version 3.4.0 (I don't know why it wouldn't work with JNA 4.0.0).

How to use it:
- download JNA 3.4.0 from here : http://mvnrepository.com/artifact/net.java.dev.jna/jna and copy the file to your Libraries folder.
- Download and copy the jWin32IdleTime.jar and jWin32IdleTime.xml files to your libraries folder.

Things you should know:
- This library works only on windows, though there is a Linux and MaxOS version at the bottom of this page : http://ochafik.com/blog/?p=98. If someone is interested in converting them, that would be great!

Special thanks to Erel, for helping me to sort out the compiling problem!
 

Attachments

Last edited:

magoandroid

Member
Licensed User
Hi @jmon,
you have already looked here?

I am attaching a zip with demo and source of a library for the GetTickCount and GetLastInputInfo functions.
The library Requires xFunction.
xFunction is a product of Excelsior, LLC http://www.excelsior-usa.com and Has Been Placed in the public domain. It may be downloaded from http://www.excelsior-usa.com/xfunctiondl.html taking note of the conditions of use.

Greetings.
magician
 

Attachments

jmon

Well-Known Member
Licensed User
Hi @jmon,
you have already looked here?
Thanks, I didn't know about this xFunction library. It looks very good, but I couldn't use it because I run on windows x64 and xFunction only has an x86 version of their dll.
 

MaFu

Well-Known Member
Licensed User
Thanks, I didn't know about this xFunction library. It looks very good, but I couldn't use it because I run on windows x64 and xFunction only has an x86 version of their dll.
You can use it on x64 Windows without problems. But you must use a 32 bit Java version.
 

jmon

Well-Known Member
Licensed User
You can use it on x64 Windows without problems. But you must use a 32 bit Java version.
Thanks, I didn't read the rest of the conversation in the forum. :)
 
Top