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

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 http://support.microsoft.com/support/kb/ar +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.


Comment on Re: Refreshing Windows desktop
Download Code
Re: Re: Refreshing Windows desktop
by Anonymous Monk on Apr 11, 2001 at 01:38 UTC
    the code doesnt work cannot load win32/api.pm @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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-07-29 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (216 votes), past polls