In JNA:
public interface User32 extends StdCallLibrary { User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class); int GetWindowTextA(PointerType hWnd, byte[] lpString, int nMaxCount); }
To use it:
byte[] windowText = new byte[512]; PointerType hwnd = ...
You might want to use the correct structure mappings for HWND, as well as enable Unicode support; You can find this information and other examples on how to do this on the MSDN website.
Documentation for JNA is available at jna.dev.java.net
Anoop
source share