Parsi Coders

نسخه‌ی کامل: سورس کد تغیر نام سطل زباله ویندوز (دلفی)
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
change the name and info tip of windows recycle bin (any windows version)

کد:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Registry, shlObj;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
application.Terminate;
end;

procedure TForm1.Button1Click(Sender: TObject);
var reg:TRegistry;
begin
if edit1.Text='' then showmessage('fill the box please!') else
if edit2.Text='' then showmessage('fill the box please!');
reg:=Tregistry.Create;
reg.RootKey:=HKEY_CLASSES_ROOT;
if reg.OpenKey('CLSID\{645FF040-5081-101B-9F08-00AA002F954E}',FALSE) then
        begin
        reg.WriteString('InfoTip',edit2.Text);
        reg.WriteString('LocalizedString',edit1.Text);
        reg.WriteString('',edit1.Text);
        end;
reg.Destroy;
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST,nil,nil);
end;

procedure TForm1.FormCreate(Sender: TObject);
var reg:TRegistry;
begin
reg:=Tregistry.Create;
reg.RootKey:=HKEY_CLASSES_ROOT;
if reg.OpenKey('CLSID\{645FF040-5081-101B-9F08-00AA002F954E}',FALSE) then
        begin
                edit1.Text:=reg.ReadString('');
                edit2.Text:=reg.ReadString('InfoTip');
        end;
reg.Destroy;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
form1.Close;
end;

end.