home *** CD-ROM | disk | FTP | other *** search
- unit PropForm;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ActiveX;
-
- type
- TObjPropForm = class(TForm)
- LblDesc: TLabel;
- LblFile: TLabel;
- Button1: TButton;
- LblCLSID: TLabel;
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- procedure ShowRegProps(const CLSID: TCLSID);
-
- implementation
-
- uses Registry, ComObj;
-
- {$R *.DFM}
-
- procedure ShowRegProps(const CLSID: TCLSID);
- var
- Reg: TRegistry;
- ClsStr, RegKey, S: string;
- begin
- Reg := TRegistry.Create;
- try
- with TObjPropForm.Create(nil) do
- try
- Reg.RootKey := HKEY_CLASSES_ROOT;
- ClsStr := GuidToString(CLSID);
- LblCLSID.Caption := LblCLSID.Caption + ClsStr;
- Reg.OpenKeyReadOnly('CLSID\' + ClsStr);
- LblDesc.Caption := LblDesc.Caption + Reg.ReadString('');
- Reg.CloseKey;
- RegKey := 'CLSID\' + ClsStr + '\InprocServer32';
- if Reg.KeyExists(RegKey) then Reg.OpenKeyReadOnly(RegKey)
- else begin
- RegKey := 'CLSID\' + ClsStr + '\LocalServer32';
- if Reg.KeyExists(RegKey) then Reg.OpenKeyReadOnly(RegKey);
- end;
- if Reg.CurrentKey <> 0 then
- begin
- S := Reg.ReadString('');
- Reg.CloseKey;
- LblFile.Caption := LblFile.Caption + S;
- end;
- ShowModal;
- finally
- Free;
- end;
- finally
- Reg.Free;
- end;
- end;
-
- end.
-