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">eccons
gmail.com>
To: delphi-en%40yahoogroups.com">delphi-en
yahoogroups.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:eccons
gmail. 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;