List Info

Thread: Dial Phone




Dial Phone
user name
2006-11-18 18:58:59

Try this..
/*****************************************
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, TapiDial;

type
TForm1 = class(TForm)
edtNumber: TEdit;
edtName: TEdit;
Button1: TButton;
TapiDialer1: TTapiDialer;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
TapiDialer1 := TTapiDialer.Create(Self);
with TapiDialer1 do
begin
PhoneNumber := edtNumber.Text;
PartyToCall := edtName.Text;
Execute;
end;
end;

end.
/*******************************************

/****** TApiDialer.pas component *******
unit TapiDial;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
ETapiDialError = class(Exception);
TTapiDialer = class(TComponent)
private
{ Private declarations }
FPhoneNumber: String;
FPartyToCall: String;
protected
{ Protected declarations }
public
{ Public declarations }
procedure Execute;
procedure CloseDialer;
published
{ Published declarations }
property PhoneNumber: String read FPhoneNumber write FPhoneNumber;
property PartyToCall: String read FPartyToCall write FPartyToCall;
end;

procedure Register;

implementation

procedure TTapiDialer.Execute;
var
NumberToDial: String;
TapiResult: LongInt;
TapiLibrary: THandle;
TapiRequestMakeCall: function (lpszDestAddress, lpszAppName,
lpszCalledParty, lpszComment: PChar): LongInt; stdcall;
begin
if FPhoneNumber = '' then
raise ETapiDialError.Create('Broj nepoznat.');
{Load the TAPI dll.}
TapiLibrary := LoadLibrary('TAPI32.DLL');
if TapiLibrary = 0 then
raise ETapiDialError.Create('Error loading TAPI32.DLL library.');
{Get the address of the dll function.}
TapiRequestMakeCall := GetProcAddress(TapiLibrary, 'tapiRequestMakeCall');
{If the number includes an area code prepend a one.}
if Length(FPhoneNumber) > 8 then
NumberToDial := '1' + FPhoneNumber
else
NumberToDial := FPhoneNumber;
{Dial the number.}
TapiResult :=
TapiRequestMakeCall(PChar(NumberToDial),'',
PChar(FPartyToCall),'');
FreeLibrary(TapiLibrary);
end;

procedure TTapiDialer.CloseDialer;
{Close the Phone Dialer if it is open.}
var
Dialer: THandle;
begin
Dialer := FindWindow(nil, 'Phone Dialer');
if Dialer <> 0 then
PostMessage(Dialer, WM_QUIT, 0, 0);
end;

procedure Register;
begin
RegisterComponents('Samples', [TTapiDialer]);
end;

end.
/*******************************

----- Original Message ----
From: eccons < eccons%40gmail.com">ecconsgmail.com>
To: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com
Sent: Saturday, November 11, 2006 8:31:17 AM
Subject: [delphi-en] Dial Phone

Hello ,

How do logic is in general to make the program dial phone ( modem to fixed phone/pstn). pc equiped modem communicate with fixed phone use head set.

is there any friends have made the applikasi , or reference link website..

please help me...

Thank's

--

Best regards,

mailto:ecconsgmail. com

<;!--

#ygrp-mlmsg {font-size:13px;font-family:arial,helvetica,clean,sans-serif;}
#ygrp-mlmsg table {font-size:inherit;font:100%;}
#ygrp-mlmsg select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}
#ygrp-mlmsg pre, code {font:115% monospace;}
#ygrp-mlmsg * {line-height:1.22em;}
#ygrp-text{
font-family:Georgia;
}
#ygrp-text p{
margin:0 0 1em 0;
}
#ygrp-tpmsgs{
font-family:Arial;
clear:both;
}
#ygrp-vitnav{
padding-top:10px;
font-family:Verdana;
font-size:77%;
margin:0;
}
#ygrp-vitnav a{
padding:0 1px;
}
#ygrp-actbar{
clear:both;
margin:25px 0;
white-space:nowrap;
color:#666;
text-align:right;
}
#ygrp-actbar .left{
float:left;
white-space:nowrap;
}
.bld{font-weight:bold;}
#ygrp-grft{
font-family:Verdana;
font-size:77%;
padding:15px 0;
}
#ygrp-ft{
font-family:verdana;
font-size:77%;
border-top:1px solid #666;
padding:5px 0;
}
#ygrp-mlmsg #logo{
padding-bottom:10px;
}

#ygrp-vital{
background-color:#e0ecee;
margin-bottom:20px;
padding:2px 0 8px 8px;
}
#ygrp-vital #vithd{
font-size:77%;
font-family:Verdana;
font-weight:bold;
color:#333;
text-transform:uppercase;
}
#ygrp-vital ul{
padding:0;
margin:2px 0;
}
#ygrp-vital ul li{
list-style-type:none;
clear:both;
border:1px solid #e0ecee;
}
#ygrp-vital ul li .ct{
font-weight:bold;
color:#ff7900;
float:right;
width:2em;
text-align:right;
padding-right:.5em;
}
#ygrp-vital ul li .cat{
font-weight:bold;
}
#ygrp-vital a {
text-decoration:none;
}

#ygrp-vital a:hover{
text-decoration:underline;
}

#ygrp-sponsor #hd{
color:#999;
font-size:77%;
}
#ygrp-sponsor #ov{
padding:6px 13px;
background-color:#e0ecee;
margin-bottom:20px;
}
#ygrp-sponsor #ov ul{
padding:0 0 0 8px;
margin:0;
}
#ygrp-sponsor #ov li{
list-style-type:square;
padding:6px 0;
font-size:77%;
}
#ygrp-sponsor #ov li a{
text-decoration:none;
font-size:130%;
}
#ygrp-sponsor #nc {
background-color:#eee;
margin-bottom:20px;
padding:0 8px;
}
#ygrp-sponsor .ad{
padding:8px 0;
}
#ygrp-sponsor .ad #hd1{
font-family:Arial;
font-weight:bold;
color:#628c2a;
font-size:100%;
line-height:122%;
}
#ygrp-sponsor .ad a{
text-decoration:none;
}
#ygrp-sponsor .ad a:hover{
text-decoration:underline;
}
#ygrp-sponsor .ad p{
margin:0;
}
o {font-size:0;}
.MsoNormal {
margin:0 0 0 0;
}
#ygrp-text tt{
font-size:120%;
}
blockquote{margin:0 0 0 4px;}
.replbq {margin:4;}
-->

__________________________________________________________
Sponsored Link

Don't quit your job - take classes online
www.Classesusa.com

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )