Change the wallpaper in Delphi

Posted in System

Use SystemParametersInfo procedure with SPI_SETDESCKWALLPAPER value.

procedure TForm1.Button1Click(Sender: TObject);
var
  St: array[0..100] of Char;
begin
  St:='C:\Windows\MyWallPaper.bmp';
  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, @St, SPIF_SENDCHANGE);
end;