解决了我自己的映射:
public interface User32 extends StdCallLibrary {
User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class,
new HashMap() {
{
put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
}
});
public static final int SPI_GETDESKWALLPAPER = 0x0073;
public static final int SPI_GETSCREENSAVERRUNNING = 114;
boolean SystemParametersInfo(
int uiAction,
int uiParam,
Pointer pvParam,
int fWinIni
);
}和用法:
IntByReference intPtr = new IntByReference();
//that's the place where i'm stuck trying to initialize with Pointer constructor
Pointer ptr = new Memory(Pointer.SIZE * 256);
User32.INSTANCE.SystemParametersInfo(User32.SPI_GETSCREENSAVERRUNNING, 0,intPtr.getPointer(), 0);
User32.INSTANCE.SystemParametersInfo(User32.SPI_GETDESKWALLPAPER,256, ptr, 0);