Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: set windows background picture

by roju (Friar)
on Jul 12, 2004 at 15:40 UTC ( [id://373632]=note: print w/replies, xml ) Need Help??


in reply to set windows background picture

The code is fine, works here on WinXP. Convert yahoo.gif to yahoo.bmp and try again.

Update: Also, take a look at Win32::Wallpaper and this article by Dave Roth - there's some code there to do it.

Update 2: Also, I know I mentioned this in a PM, but Active Desktop doesn't play nice - make sure to get rid of it. Looks like your code is the same as Simple script to change win32 wallpaper, which is two years old and hasn't had a complaint - so it's my guess that, as I originally suspected - it's not the code.

Replies are listed 'Best First'.
Re^2: set windows background picture
by pg (Canon) on Jul 12, 2004 at 19:33 UTC

    Thanks roju for all your helps, including those chats you sent me.

    For your update 2, It still does not work for me even with active desktop disabled.

    For update 1, I looked at the source code for Win32::Wallpaper, and made up this to mimic it:

    use strict; use warnings; use Win32::API; my $SystemParametersInfo = new Win32::API(qw(user32 SystemParametersIn +foA NNPN N)) || die $^E; $SystemParametersInfo->Call( 20, 0, "c:\\perl582\\bin\\yahoo.bmp",1 ) +|| die $^E;

    Unfortunately it still does not work. But yes, I agree with you, my source code was most likely alright. Something is wrong ;-)


      I tested here in a Win 2000 and it didn't work also...
      (so it is not only you :))
      I really really really hate this answer, but did you try rebooting? I remember seeing code up here to change the wallpaper and thinking it was very cool, only to find that the change was not effected immediately.
Re^2: set windows background picture
by pg (Canon) on Jul 12, 2004 at 15:50 UTC

    Converted the picture to .bmp, but it didn't work, and return code became 1.

    Tried to set through windows by right click on desktop, both .gif and .bmp worked...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://373632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found