Mega Code Archive

 
Categories / Delphi / Examples
 

Expert enumerates all installed components

Question: How can my IDE Add-In expert enumerate all installed components? Answer: Borland's interface for IDE services provides the function GetComponentName() which takes two arguments - the index of the package and the index of the component within a package. It can be used as shown below. library IDEAddInExpert; uses ToolsApi; //.. procedure EnumerateInstalledComponents; var a, i: integer; begin { EnumerateInstalledComponents } with BorlandIDEServices as IOTAPackageServices do begin for a := 0 to GetPackageCount-1 do begin for i := 0 to GetComponentCount(a)-1 do begin sName := GetComponentName(a, i); // name of installed component end; { for i } end; { for a } end; { with } end; { EnumerateInstalledComponents } //.. end.