• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] How to set desktop wallpaper

This topic is 6274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve searched for some java code that is capable of resetting the desktop''s wallpaper, but I haven''t been able to find any that works. Can anyone help? THanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
why would you ever want to do that? Do you know how angry you might make some people who run your program?

Share this post


Link to post
Share on other sites
Its not for the public, but rather myself, and possibly an applet version for anyone who cares- forewarned of course.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
oh ok. No I don''t know how to do it. You probably can''t just use java to do that, since java is sort of a lowest common denomimator thing, it has to work on all platforms.

Share this post


Link to post
Share on other sites
Yup,

You cannot do this in Java, as it requires win32 calls.

You can do it via JNI, though. I must admit, though, that I don''t know the exact calls to use. But it can be done.

Jacob Marner

Share this post


Link to post
Share on other sites
Yes, it can be done. I''ve played with this idea before and it could be applied to java as well. All you need to do it..

1) It must be running as an application! This can NOT be done from an applet.

2) You need a Image -> BMP converter

3) Basic understanding of regedit files.

Ok to make life easier if you settle on one filename for you wallpaper it will make it easier. Set it up the way you want and export ( in regedit )

HKEY_LOCAL_USER/Control Panel/Desktop

Delete all unnecessary config lines from the file and save this as restoreWall.reg or something to that extent. Now whenever you want to restore your wallpaper or install a new one, just drop your .bmp over the old one and call "regedit -q restoreWall.reg".

Unfortunatly you will need to restart to make this work. You may be able to do something cleaner with the M$ java com interface but I''m not the one to ask.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Make JNI function that calls SystemParametersInfo.
with the uiAction parameter set to SPI_SETDESKWALLPAPER.

Share this post


Link to post
Share on other sites

  • Advertisement