Set wallpaper

How do I set the wallpaper in windows in a "professional" way? I want to be able to choose alignment and tile on/of etc.
jonassondanielAsked:
Who is Participating?
 
BlackDeathConnect With a Mentor Commented:
ok, thanx.
bye,
BlackDeath.
0
 
BlackDeathCommented:
hi, j.
try this:

procedure ChangeWallpaper(BmpName: string; Tile: Boolean);
var
  Reg: TRegIniFile;
begin
  Reg := TRegIniFile.Create('Control Panel');
  Reg.WriteString('desktop', 'Wallpaper' ,BmpName);
  if tile then
    Reg.WriteString('desktop', 'TileWallpaper', '1')
  else
    Reg.WriteString('desktop', 'TileWallpaper', '0');  
  Reg.Free;
  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, nil, SPIF_SENDWININICHANGE);
end;

& then call

ChangeWallpaper('C:\LOGO.BMP' , False);
0
 
jonassondanielAuthor Commented:
thanks, blackdeath. it works nicely. Please "propose answer" so I can reward you.
0
All Courses

From novice to tech pro — start learning today.