Source Code



Change Desktop Wallpaper Windows

  • anonymous
  • Jan 16' 14
  • Delphi
  • 203
  • 176
  • United States

wallpaper pasarkode

 


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,Registry, Buttons, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Edit1: TEdit;
    SpeedButton1: TSpeedButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  procedure  Wallpaper;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Wallpaper;
var
Reg: TRegIniFile;
begin
  Reg := TRegIniFile.Create('Control Panel');
  Reg.WriteString('desktop', 'Wallpaper', Edit1.Text);
  Reg.WriteString('desktop', 'TileWallpaper', '1');
  Reg.Free;
  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, nil,
  SPIF_SENDWININICHANGE);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  WallPaper;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  fPathName : String;
  fFileName : String;
begin
  OpenDialog1.Execute;
  fPathName := ExtractFilePath(OpenDialog1.FileName);
  fFileName := ExtractFileName(OpenDialog1.FileName);
  Edit1.Text := fPathName + fFileName;
  image1.Picture.loadfromfile(fPathName + fFileName);
end;

end.
  • Tags : wallpaper, desktop, windows
comments powered by Disqus

Related Code

Windows Ballon

Hide desktop Icon

Detect Aero Glass using Delphi

Retrive Windows Product Key

Make the dektop icon text transparent

Check or Validate e-mail address

Disable/enable taskbar



Category