値が DLL 関数によって変更される引数は、InOutArgument (値を変更する場合)、または OutArgument を使用して渡す必要があります。
この例では、現在のカーソル位置を取得するために、user32.dll の GetCursorPos 関数を使用しています。
@Dll( "user32.dll" )
public interface IUserDll32Functions {
int GetCursorPos( OutArgument<Point> point);
}
IUserDll32Functions user32Function = DllCall.createAgentDllCall(IUserDll32Functions.class, desktop);
OutArgument<Point> point = new OutArgument<Point>(Point.class);
user32Function.GetCursorPos(point);
System.out.println("cursor position = " + point.getValue());