Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Refreshing Windows desktop

by RhetTbull (Curate)
on Apr 10, 2001 at 22:54 UTC ( #71444=note: print w/replies, xml ) Need Help??

in reply to Refreshing Windows desktop

The following snippet will change the background using a Win32::API call to SystemParametersInfo but note that if the users are using Windows 2000 and ActiveDesktop, the ActiveDesktop background gets layered OVER the normal background so they won't see the change. I'll see if I can find a solution to change the ActiveDesktop background as well and post it here.

use warnings; use Win32::API; my $SystemParametersInfo = new Win32::API("user32","SystemParametersIn +fo",[ I,I,P,I ],I); if (not defined $SystemParametersInfo ) { die "could not import SystemParametersInfo"; } my $wallpaper = "c:\\winnt\\Blue Lace 16.bmp"; my $action = 20; #reference +ticles/Q97/1/42.ASP to see which constant to use my $saveWinINI = 0; #save this in the user profile? my $param = 0; #dependent on what $action is #change the wallpaper my $retval = $SystemParametersInfo->Call($action,$param,$wallpaper,$sa +veWinINI);
For more info on SystemParametersInfo look here and here.

Replies are listed 'Best First'.
Re: Re: Refreshing Windows desktop
by Anonymous Monk on Apr 11, 2001 at 01:38 UTC
    the code doesnt work cannot load win32/ @inc contains e;\perl\lib (ect ect) E: is where perl is and D: is where winnt is... i changed of course the obvious c: to d: in your code....
      Did you install the Win32::API module? If you're using ActiveState perl you can use ppm to install it. I don't recall the exact syntax but I think you can do something like:

      c:\>ppm PPM> install Win32::API PPM> quit
      You could also look here.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://71444]
and the monks are chillaxin'...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-04-21 22:13 GMT
Find Nodes?
    Voting Booth?