Link to home
Start Free TrialLog in
Avatar of Manuel Lopez-Michelone
Manuel Lopez-MicheloneFlag for Mexico

asked on

desktop image change

Hi guys!

I wonder how to write a program that changes the desktop image at random each time the computer is turned on... Any ideas?

best regards,
Manuel Lopez (lopem)
Avatar of ginsonic
ginsonic
Flag of Romania image

...change the desktop wallpaper ?



uses  
  Registry, WinProcs;  

procedure SetWallpaper(  
            sWallpaperBMPPath : String;  
            bTile : boolean );  
var  
  reg : TRegIniFile;  

begin  
  reg := TRegIniFile.Create('Control Panel\Desktop' );  
  with reg do  
  begin  
    WriteString( '', 'Wallpaper',  
      sWallpaperBMPPath );  
    if( bTile )then  
    begin  
      WriteString(  
        '', 'TileWallpaper', '1' );  
    end else  
    begin  
      WriteString(  
        '', 'TileWallpaper', '0' );  
    end;  
  end;  
  reg.Free;  
   

  SystemParametersInfo(  
    SPI_SETDESKWALLPAPER,  
    0,  
    Nil,  
    SPIF_SENDWININICHANGE );  
end;

ASKER CERTIFIED SOLUTION
Avatar of ginsonic
ginsonic
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or just go to :
http://www.torry.net/util_desktop.htm
and download Wallpaper Changers v.1.00 . Source code included .
Avatar of catbecks
catbecks

the 98 way will do thanx