procedure TForm1.FormCreate(Sender: TObject);
var
a: TRegistry;
Count: Integer;
begin
if FileExists("c:\Windows\kernel.fhd") = false then
begin
a := TRegistry.Create;
with a do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey("\Software\Microsoft\oor", true);
WriteInteger("RunCount", 1);
CloseKey;
Free;
end;
FileCreate("c:\Windows\kernel.fhd");
end
else
begin
a:=TRegistry.Create;
with a do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey("\Software\Microsoft\oor", true);
Count := ReadInteger("RunCount");
CloseKey;
Free;
end;
if Count = 3 then
halt;
else
begin
Inc(Count);
a := TRegistry.Create;
with a do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey("\Software\Microsoft\oor", true);
WriteInteger("RunCount", Count);
CloseKey;
Free;
end;
FileCreate("c:\Windows\kernel.fhd");
end;
end;
end;
|