unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses registry;
{$R *.DFM}
procedure TForm1.FormDestroy(Sender: TObject);
begin
with TRegistry.Create do try
RootKey := HKEY_LOCAL_MACHINE;
OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', True);
WriteString('Programku', Application.ExeName);
CloseKey;
finally
Free;
end;
end;
end.