how to set windows wallpaper in java -


this have found on stackoverflow. looking java class change windows wallpaper me in windows 7.

public class changewallpaper { public static void main(string[] args) { //supply own path instead of using 1 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 code stackoverflow

assuming code you've posted you're trying use... you've not included body of spi interface. it's shot in dark considering didn't tell error eclipse throwing. if want more specific help, you'll need more specific saying parts of code "red." not us.

copy full code stackoverflow link you've posted , ought work.

also, while unrelated problem, class name should changed consistent java standards. see http://www.oracle.com/technetwork/java/codeconv-138413.html


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -