Unit1.~pas
上传用户:newxcj
上传日期:2020-02-13
资源大小:12k
文件大小:1k
源码类别:

PlugIns编程

开发平台:

Delphi

  1. unit Unit1;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs,registry, StdCtrls;
  6. type
  7.   TForm1 = class(TForm)
  8.     Button1: TButton;
  9.     procedure Button1Click(Sender: TObject);
  10.   private
  11.     { Private declarations }
  12.   public
  13.     { Public declarations }
  14.   end;
  15. var
  16.   Form1: TForm1;
  17. implementation
  18. {$R *.dfm}
  19. procedure createxplorerbutton(path:string);
  20. const
  21. tagit='{10954c80-4F0F-11d3-B17C-00C0DFE39736}';
  22. var
  23. reg:tregistry;
  24. path1:string;
  25. merg:string;
  26. begin
  27. path:='c:';
  28. reg:=tregistry.Create;
  29. try
  30. with reg do
  31. begin
  32. rootkey:=HKEY_LOCAL_MACHINE;
  33. path1:='SoftwareMicrosoftInternet ExplorerExtensions';
  34. merg:=path1+tagit;
  35. openkey(merg,true);
  36. writestring('buttontext','butoontext');
  37. writestring('MenuText','Tools Menu Item');
  38. writestring('MenuStatusBar','Run Script');
  39. writestring('Clsid','{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}');
  40. writestring('Default Visible','Yes');
  41. writestring('Exec',path+'ProgramName.exe');
  42. writestring('HotIcon',',4');
  43. end
  44. finally
  45. reg.CloseKey;
  46. reg.Free;
  47. end;
  48. end;
  49. procedure TForm1.Button1Click(Sender: TObject);
  50. begin
  51. createxplorerbutton('1');
  52. end;
  53. end.