function GetOCXPath(var Path: string): Boolean;
const
HHPathRegKey = 'CLSID\{adb880a6-d8ff-11cf-9377-00aa003b7a11}\InprocServer32';
var
TmpStr: array[0..255] of Char;
begin
with TRegistry.Create do
try
RootKey := HKEY_CLASSES_ROOT;
if OpenKeyReadOnly(HHPathRegKey) then Path := ReadString('');
FillChar(TmpStr, SizeOf(TmpStr), 0);
ExpandEnvironmentStrings(PChar(Path), TmpStr, SizeOf(TmpStr));
Path := TmpStr;
Result := (Path <> '') and FileExists(Path);
finally
Free;
end;
end;