Hello,
I finnaly figured out how to use this with java. this tutorial has been made with eclipse 4.3.1 and the jdk 1.7x64.
go on this page http://www.autohotke...-autohotkeydll/ and click on
"* AutoHotkey_H is HotkeyIt's custom build (most uptodate)." to download the last package.
unrar the package, we are only interested by autohotkey.dll present in the folder 'x64w'
you do not need the other files and autohotkey does not need to be installed.
Create a new java project, you get this :
create a new package in the src folder and a new java class in the previously created package
Download the JNA library : https://github.com/twall/jna
direct download link : https://maven.java.n...0/jna-4.1.0.jar
right clic on the project>new>folder name it "libs", drag and drop jna inside
rignt clic on the project>new>folder name it "dlls", drag and drop autohotkey.dll inside
now go to the build path windows :
rignt clic on the project>properties>java Build Path clic on "Add JARs..."
select jna-4.1.0.jar present in the folder "libs" and press "OK"
Clic on "Add Class Folder" (in the java build path windows in case you already closed it)
select/check the "libs" folder, press "OK"
then close the java build path windows by pressing "OK"
Copy this piece of code inside DllController.java
package fr.mssb.autohotkey; import com.sun.jna.Library; import com.sun.jna.Native; public class DllController { public interface autoHotKeyDll extends Library { public void ahkExec(char[] s); public void ahktextdll(char[] s); } public static void main(String args[]) throws InterruptedException { System.out.println("running in " + System.getProperty("sun.arch.data.model")); System.out.println("Loading dll"); autoHotKeyDll lib = (autoHotKeyDll) Native.loadLibrary("AutoHotkey", autoHotKeyDll.class); System.out.println("initialisation"); lib.ahktextdll("#Persistent".toCharArray()); Thread.sleep(100); System.out.println("displaying cbBox"); lib.ahkExec("msgbox,,Hellow!,Hellow World!".toCharArray()); } }
And you should get this :
Enjoy