DelphiFAQ Home Search:
General :: Programming :: Delphi :: Delphi IDE
Information about the Delphi IDE, add-in experts and wizards.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

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.
You don't like the formatting? Check out SourceCoder then!
Generated 12:01:10 on Nov 13, 2018