I've never actually tried to use native methods before, so bear with me.
I am trying to use SystemParametersInfo to change my wallpaper with a java program, and it's not working. The code compiles and runs, but nothing happens.
public class MagicWallPaper
{
public static native int SystemParametersInfo(int uiAction, int uiParam, String pvParam, int fWinIni);
static
{
System.loadLibrary("user32");
}
public static void main(String args[])
{
String dan = "C:\\Users\\1023\\Desktop\\DanMyer.jpg";
SystemParametersInfo(20, 0, dan, 1);
}
}
I've tried using SystemParametersInfoA and SystemParametersInfoW, as well as passing both 0 and 1 for the last parameter. Microsoft docs don't help much, they just say:
Note When the SPI_SETDESKWALLPAPER flag is used, SystemParametersInfo returns TRUE unless there is an error (like when the specified file doesn't exist).
All I have is this and user32.dll in the same folder.