이것은 내가 stackoverflow에서 발견 한 것입니다. 나는 당신이 ... 당신을 사용하려는 정확히 당신이 게시 한 코드를 가정 윈도우 7자바에서 windows 벽지를 설정하는 방법
public class changewallpaper {
public static void main(String[] args) {
//supply your own path instead of using this one
String path = "C:\\Users\\d1j5\\Pictures\\asgardrealmofthegods.jpg";
SPI.INSTANCE.SystemParametersInfo(
new UINT_PTR(SPI.SPI_SETDESKWALLPAPER),
new UINT_PTR(0),
path,
new UINT_PTR(SPI.SPIF_UPDATEINIFILE | SPI.SPIF_SENDWININICHANGE));
} public interface SPI extends StdCallLibrary {
//from MSDN article
long SPI_SETDESKWALLPAPER = 20;
long SPIF_UPDATEINIFILE = 0x01;
long SPIF_SENDWININICHANGE = 0x02;
SPI INSTANCE = (SPI) Native.loadLibrary("user32", SPI.class, new HashMap<Object, Object>() {
{
put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
} }); boolean SystemParametersInfo(
UINT_PTR uiAction,
UINT_PTR uiParam,
String pvParam,
UINT_PTR fWinIni
);
}
}
source for the code from stackoverflow
무엇이 문제입니까? –
좋아, 너 그렇게 발견 했어, 무슨 일이야? – Alfabravo
게시 할 때 끝나지 않았지만 문제는 어떻게 작동합니까? 예제 코드는 나를 위해 작동하지 않는 다른 게시물의 답변입니다. – jerhynsoen