main.~pa
资源名称:TAPIVer3.zip [点击查看]
上传用户:xtonglei
上传日期:2019-08-12
资源大小:6118k
文件大小:3k
源码类别:
TAPI编程
开发平台:
C++ Builder
- unit main;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, AssistedTAPI, StdCtrls;
- type
- TForm1 = class(TForm)
- Edit1: TEdit;
- Label1: TLabel;
- Edit5: TEdit;
- Label5: TLabel;
- Button1: TButton;
- Button2: TButton;
- AssistedTAPI1: TAssistedTAPI;
- Label6: TLabel;
- Label7: TLabel;
- GroupBox1: TGroupBox;
- Label2: TLabel;
- Label3: TLabel;
- Edit4: TEdit;
- Label4: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Label10: TLabel;
- Label11: TLabel;
- procedure Edit1Change(Sender: TObject);
- procedure Edit4Change(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Edit5Change(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure AssistedTAPI1InvalDestAddress(Sender: TObject);
- procedure AssistedTAPI1NoRequestRecipient(Sender: TObject);
- procedure AssistedTAPI1RequestFailed(Sender: TObject);
- procedure AssistedTAPI1RequestQueueFull(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Edit1Change(Sender: TObject);
- begin
- AssistedTAPI1.CalledParty:=Edit1.Text;
- end;
- procedure TForm1.Edit4Change(Sender: TObject);
- begin
- AssistedTAPI1.DestAddress:=Edit4.Text;
- end;
- procedure TForm1.Edit5Change(Sender: TObject);
- begin
- AssistedTAPI1.Comment:=Edit5.Text;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- Label8.Caption:=AssistedTAPI1.CountryCode;
- Label9.Caption:=AssistedTAPI1.CityCode;
- AssistedTAPI1.DestAddress:=Edit4.Text;
- AssistedTAPI1.Comment:=Edit5.Text;
- AssistedTAPI1.CalledParty:=Edit1.Text;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- AssistedTAPI1.MakeCall;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- Close;
- end;
- { On Windows 2000 and XP the following events never occur with dialer.exe}
- procedure TForm1.AssistedTAPI1InvalDestAddress(Sender: TObject);
- begin
- MessageDlg('The entered phone number is wrong',mtError,[mbOK],0);
- end;
- procedure TForm1.AssistedTAPI1NoRequestRecipient(Sender: TObject);
- begin
- MessageDlg('Please install Dialer.exe or an other TAPI Svr',mtError,[mbOK],0);
- end;
- procedure TForm1.AssistedTAPI1RequestFailed(Sender: TObject);
- begin
- MessageDlg('Request failed',mtError,[mbOK],0);
- end;
- procedure TForm1.AssistedTAPI1RequestQueueFull(Sender: TObject);
- begin
- MessageDlg('The Querry is full, please try later',mtError,[mbOK],0);
- end;
- end.