Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
Enumerating Borland Application Servers
This article has not been rated yet. After reading, feel free to leave comments and rate it.
There is no ready-to-use place in the registry where all (Borland) application servers have to register besides the standard list of classes.
The way to retrieve all registered Borland Application Servers is to enumerate all registered classes and check in each wether it has the subkey 'Borland DataBroker'. If this test is positive, then the program's ID can be retrieved and - in the example below - be added to a listbox where a user may choose from.  | |  | | unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
lbAppServers: TListBox;
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
uses
Registry;
procedure TForm1.FormCreate;
var
i: Integer;
tmpServerList: TStringList;
begin
tmpServerList := TStringList.Create;
lbAppServers.Clear;
with TRegistry.Create do
begin
try
RootKey := HKEY_CLASSES_ROOT;
if OpenKey('CLSID', False) then
begin
GetKeyNames(tmpServerList)
end;
for i := 1 to tmpServerList.Count-1 do
begin
if KeyExists('CLSID\'+tmpServerList[i]+'\Borland DataBroker') then
begin
if OpenKey('CLSID\'+tmpServerList[i]+'\ProgID', False) then
begin
lbAppServers.Items.Add(ReadString(''));
end;
end;
end
finally
Free;
end;
end;
tmpServerList.Clear;
tmpServerList.Free;
end;
end. | |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|