implementation
{$R *.DFM}
uses registry;
procedure TForm1.FormCreate(Sender: TObject);
var reg:TRegistry;
begin
reg:=TRegistry.Create;
with reg do begin
try
if OpenKey('\Control Panel\desktop', False) then begin
//change wallpaper and tile it
reg.WriteString ('Wallpaper','c:\windows\CIRCLES.bmp');
reg.WriteString ('TileWallpaper','1');
//disable screen saver//('0'=disable, '1'=enable)
reg.WriteString('ScreenSaveActive','0');
//update changes immediately
SystemParametersInfo
(SPI_SETDESKWALLPAPER,0, nil,SPIF_SENDWININICHANGE);
SystemParametersInfo
(SPI_SETSCREENSAVEACTIVE,0, nil,SPIF_SENDWININICHANGE);
end
finally
reg.free
end;
end;
end;