procedure TForm1.GetActiveXObjects(List: TStringList);
procedure KeyNotFound;
begin
raise exception.create('Key not found.');
end;
const
PATH = 'Software\\Classes\\TypeLib\\';
var
R: TRegistry;
S1, S2: TStringList;
S, Output: String;
begin
List.Clear;
try
S1 := TStringList.Create;
S2 := TStringList.Create;
R := TRegistry.create(KEY_READ);
R.RootKey := HKEY_LOCAL_MACHINE;
if (not R.OpenKey(PATH, False)) then
KeyNotFound;
R.GetKeyNames(S1);
for S in S1 do begin
// Position: CLSID
R.CloseKey;
if (not R.OpenKeyReadOnly(PATH + S + '\\')) then
Continue;
R.GetKeyNames(S2);
// Position:Version
if (S2.Text = '') or (not R.OpenKeyReadOnly(S2.Strings[0])) then
Continue;
Output := R.ReadString('');
if Output <> '' then
List.Add(Output);
end;
finally
R.Free;
S1.Free;
S2.Free;
end;
end;반응형
'Delphi' 카테고리의 다른 글
| [Delphi] MS Excel Automation in Delphi (0) | 2022.05.14 |
|---|---|
| [Delphi] How to get the Memory Used by a Delphi Program (0) | 2022.05.14 |
| [Delphi] DataSnap방식으로 Client에서 Server로 이미지를 upload하는 방식 (0) | 2022.05.13 |
| [Delphi] Custom drawing of menu items (0) | 2022.05.13 |
| [Delphi] [JSON] ip로 위치 정보 알아내기 (0) | 2022.03.29 |