Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JAVA/VB SCript to set a picture as wallpaper

Status
Not open for further replies.

TudorSmith

Programmer
Jan 14, 2002
245
GB
Hi,

I have a webpage which shows pictures. I'd like to have a button underneath each picture with the caption "Set as Wallpaper", and when the user clicks the button, the image becomes the wallpaper.

Sounds easy enough...but I need help!

Anyone got any code for this?

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Hi birklea,

If you mean that you wish the image to become the tiled background image for the page then you will need dhtml:
Code:
<form name=&quot;frm&quot; onsubmit=&quot;return false&quot;>
<img src=&quot;mypic.gif&quot; id=&quot;pic1&quot; name=&quot;pic1&quot;>
<input type-&quot;button&quot; value=&quot;select pic1&quot;
       onclick=&quot;document.body.style.backgroundImage='url(pic1.gif)'&quot;>
</form>
 
No...not that!

You know you can &quot;Right click&quot; on an image in a browser window, and select &quot;Set as Wallpaper&quot;? I would like that bit of code so I can set it behind a button on my webpage.

Thanks

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Because of the potential problems of someone's website changing a computer's wallpaper without their permission, what you're asking for isn't possible. Anything that can be done by clicking on a button can be done WITHOUT clicking on a button, too, against the wishes of the viewer.
 
That I understand, but then you would argue that a &quot;MAILTO&quot; button should also not be allowed, since it could cause the user's email package to send an email out withou ttheir permission, and yet I see countless web pages with buttons saying &quot;Send Mail&quot;.

So, if the browser can allow the setting of a picture as the windows wallpaper, then their must also be some HTML that one can place behind a button to allow the user to perform the exact same task, but with fewer mouse clicks!

Thanks for your input though!

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top