Ir al contenido


Foto

[TRUCO DELPHI] Version del BDE Instalada, usando el Registro ?


  • Por favor identifícate para responder
No hay respuestas en este tema

#1 sir.dev.a.lot

sir.dev.a.lot

    Advanced Member

  • Miembros
  • PipPipPip
  • 545 mensajes
  • Location127.0.0.1

Escrito 01 diciembre 2016 - 07:58

[TRUCO DELPHI] Version del BDE Instalada, usando el Registro ?


delphi
  1. uses
  2. BDE, Registry, Windows;
  3. // ...
  4. function GetBDEVersion: string;
  5. var
  6. hDll : hWnd;
  7. pFunc : Pointer;
  8. sIdAPI : string;
  9. SysVer : SYSVersion;
  10. SysVerProc: TSYSVerProc;
  11. begin
  12. Result := '';
  13. with TRegistry.Create do
  14. try
  15. RootKey := HKEY_CLASSES_ROOT;
  16. if OpenKey('CLSID{FB99D710-18B9-11D0-A4CF-00A024C91936}InProcServer32', False) then begin
  17. sIdAPI := ReadString('');
  18. CloseKey;
  19. end;
  20. finally
  21. Free;
  22. end;
  23.  
  24. hDll := LoadLibrary(PChar(idapi));
  25. if hDll <> 0 then
  26. try
  27. pFunc := GetProcAddress(hDll, 'DbiGetSysVersion');
  28. if pFunc <> nil then begin
  29. SysVerProc := pFunc;
  30. SysVerProc(SysVer);
  31. Result := IntToStr(SysVer.iVersion);
  32. Insert('.', Result, 2);
  33. end;
  34. finally
  35. FreeLibrary(hDll);
  36. end;
  37. end;

Saludos!


  • 1




IP.Board spam blocked by CleanTalk.