ThbTapiLine.DeviceList
Unit: hbTapi
 

The DeviceList is a list of available TAPI line devices according to the Windows operating system. The devices are listed in the order of there DeviceID. There are DeviceList.Count - 1 devices listed and the first device has an index (DeviceID) of 0. Because of this, do never sort this property. Use always a copy to do so.

Example

procedure TForm1.FormCreate(Sender: TObject);
var DeviceID: Integer;
begin
  ComboBox1.Items.Assign(HbTapiLine1.DeviceList);
  for DeviceID:= 0 to ComboBox1.Items.Count-1 do
  ComboBox1.Items.Objects[DeviceID] := TObject(DeviceID);
  ComboBox1.Sorted := True;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
var DeviceID: Integer;
begin
  DeviceID := Integer(ComboBox1.Items.Objects[ComboBox1.ItemIndex]);
  HbTapiLine1.DeviceID := DeviceID;
  if HbTapiLine1.Available then
  Label1.Caption := HbTapiLine1.DeviceName + ' is available with DeviceID ' + IntToStr(HbTapiLine1.DeviceID)
    else
  Label1.Caption :='There is no line device available with DeviceID ' + IntToStr(HbTapiLine1.DeviceID);
end;

The DeviceID is a temporary id of the device which may change as lines are added or removed from the system. To store a lines user configuration, use the DeviceName and the PermanentDeviceID.

Availability

Design-Time: None / Run-Time: Read

Declaration

property DeviceList: TStrings;

See Also

ThbTapiLine.DeviceName, ThbTapiLine.DeviceID, ThbTapiLine.PermanentDeviceID, ThbTapiLine.Available