Unit1.~pas
上传用户:newxcj
上传日期:2020-02-13
资源大小:12k
文件大小:1k
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs,registry, StdCtrls;
- type
- TForm1 = class(TForm)
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure createxplorerbutton(path:string);
- const
- tagit='{10954c80-4F0F-11d3-B17C-00C0DFE39736}';
- var
- reg:tregistry;
- path1:string;
- merg:string;
- begin
- path:='c:';
- reg:=tregistry.Create;
- try
- with reg do
- begin
- rootkey:=HKEY_LOCAL_MACHINE;
- path1:='SoftwareMicrosoftInternet ExplorerExtensions';
- merg:=path1+tagit;
- openkey(merg,true);
- writestring('buttontext','butoontext');
- writestring('MenuText','Tools Menu Item');
- writestring('MenuStatusBar','Run Script');
- writestring('Clsid','{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}');
- writestring('Default Visible','Yes');
- writestring('Exec',path+'ProgramName.exe');
- writestring('HotIcon',',4');
- end
- finally
- reg.CloseKey;
- reg.Free;
- end;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- createxplorerbutton('1');
- end;
- end.