我正在尝试从特定的 Delphi 版本中获取项目 MRU 列表:
function GetDelphiMRUList(const verstr: string; var MRUList: TStringList): Boolean;
var
Reg: TRegistry;
begin
Result := False;
MRUList.Text := '';
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKeyReadOnly('SOFTWARE\Embarcadero\BDS\' + verstr);
Result := Reg.KeyExists('Closed Projects');
Reg.CloseKey;
if Result then
begin
// How to get the MRUList?
end;
finally
Reg.Free;
end;
end;
用法:
procedure TForm1.FormCreate(Sender: TObject);
begin
var MRUList: TStringList;
MRUList := TStringList.Create;
try
if GetDelphiMRUList('22.0', MRUList) then
CodeSite.Send('TForm1.FormCreate: MRUList', MRUList);
finally
MRUList.Free;
end;
end;
我一直在获取已关闭项目的列表。