uses
Registry;
procedure TForm1.Button1Click(Sender: TObject);
var Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_CLASSES_ROOT;
Reg.LazyWrite := false;
Reg.OpenKey('.jpg', true);
Reg.WriteString('',''+Form1.Caption+'.Image');
Reg.CloseKey;
Reg.OpenKey('.jpg\shell\open\command', true);
Reg.WriteString('',application.ExeName+' %1');
Reg.CloseKey;
Reg.OpenKey('.jpg\DefaultIcon',true);
Reg.WriteString('',application.ExeName+',0');
Reg.CloseKey;
Reg.free;
end;
|