Saturday, 11 August 2012

Programatically setting wallpaper


Last week when i was doing random visit at forums I found a Question 
How to Programatically set wallpaper in windows" so i have written a code to solve this problem of that guy..... 
Setting wallpaper in windows is never this easy, all you need is my API to set & get wallpaper, this library is part of my Utilities framework and written in Java. After you have set my library in your classpath (For those who don't know how to set classpath), all you have to do is follow the below instructions


Things you should know before using this API



In windows platform when we set any image as a wallpaper, windows actually copy the image into directory "C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Themes" and name it as "TranscodedWallpaper". So when ever you set any wallpaper try browsing this directory and see the result. If you haven't understand this no problem!
Go ahead and try the API you will understand the working...

  • To set wallpaper in windows just use this code 
new Wallpaper().setWallpaper( Path );
  • To get current wallpaper's path use this code
new Wallpaper().getWallpaper();

Current version 1.0 is for Windows only.

Note: Always download latest builds.