delphi3
asked on
Get the modem to connect with a ISP.
I have D4 standard edition and Win98. I can use a safe call to bring up most any xxxx.exe. I can write instructions similar to:
procedure TForm1.Button1Click(Sender : TObject);
var
Str1,Str2,Totalcmdline:str ing;
c:char;
begin
Str1:='C:\program Files\Netscape\Communicato r\program\ netscape.e xe';
Str2:='http://tycho.usno.navy.mil';
Totalcmdline := str1+' "' + str2+' "';
Cprocess(Totalcmdline,Self );
end;
procedure TForm1.Cprocess(sExecuteFi le:string; Sender: TObject);
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof(si),0);
si.cb:=sizeof(si);
CreateProcess(Nil,PChar(sE xecuteFile ),nil, nil, false, NORMAL_PRIORITY_CLASS, Nil, Nil,si,pi );
// close up shop...
closeHandle(pi.hProcess);
closeHandle(pi.hThread);
end;
I would like bring up my modem to call my ISP. If I use for Str1 in the above program as Str1 := 'MyComputer\Dial-Up Networking\MyModemConnecti on.exe';
However, this does not work. So what should I use instead to cause the modem to dial the ISP?
Delphi3
procedure TForm1.Button1Click(Sender
var
Str1,Str2,Totalcmdline:str
c:char;
begin
Str1:='C:\program Files\Netscape\Communicato
Str2:='http://tycho.usno.navy.mil';
Totalcmdline := str1+' "' + str2+' "';
Cprocess(Totalcmdline,Self
end;
procedure TForm1.Cprocess(sExecuteFi
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof(si),0);
si.cb:=sizeof(si);
CreateProcess(Nil,PChar(sE
// close up shop...
closeHandle(pi.hProcess);
closeHandle(pi.hThread);
end;
I would like bring up my modem to call my ISP. If I use for Str1 in the above program as Str1 := 'MyComputer\Dial-Up Networking\MyModemConnecti
However, this does not work. So what should I use instead to cause the modem to dial the ISP?
Delphi3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oops,
I reread the name of the unit that I named it above at first. It should have read
unit SafeCallNoCaptionUnit1;
because later that is what was the final outcome.
Delphi3
I reread the name of the unit that I named it above at first. It should have read
unit SafeCallNoCaptionUnit1;
because later that is what was the final outcome.
Delphi3
ASKER
This SafeCAll unit will show the solution in addition to the revision in RAS Test noted below that.
unit SafeCallNoFormUnit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
HarmFade;
type
TForm1 = class(TForm)
HarmFade1: THarmFade;
procedure FormCreate(Sender: TObject);
procedure HarmFade1MouseEnter(Sender
private
procedure Cprocess(sExecuteFile:stri
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
// using this as a way to launch the program
procedure TForm1.FormCreate(Sender: TObject);
var
Str1,Str2,Str3,Totalcmdlin
begin
//Ras PhoneDialer
Str1:='C:\WINDOWS\Desktop\
Totalcmdline := str1+' "';
Cprocess(Totalcmdline,Self
//Custom RAS phone timer keeps track of the time used while on internet
Str2:='C:\WINDOWS\Desktop\
Totalcmdline := str2+' "';
Cprocess(Totalcmdline,Self
//MS Outlook Express
Str3:='C:\Program Files\Outlook Express\Msimn.exe';
Totalcmdline := str3+' "';
Cprocess(Totalcmdline,Self
end;
procedure TForm1.Cprocess(sExecuteFi
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof(si),0);
si.cb:=sizeof(si);
CreateProcess(Nil,PChar(sE
// close up shop...
closeHandle(pi.hProcess);
closeHandle(pi.hThread);
end;
// slide the mouse over this small rectangular
// form that has no caption bar will activate program closing
procedure TForm1.HarmFade1MouseEnter
begin
Application.Terminate;
end;
end.
// form1 as text
object Form1: TForm1
Left = 712
Top = 330
BorderIcons = []
BorderStyle = bsNone
Caption = 'Form1'
ClientHeight = 41
ClientWidth = 105
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object HarmFade1: THarmFade
Left = 0
Top = 0
Width = 105
Height = 41
OnMouseEnter = HarmFade1MouseEnter
ColorFrom = clBlue
end
end
And this is the addition to dialup ras program from Alex above
procedure TfrmTest.FormCreate(Sender
begin
btnGetEntriesClick(Self);
btnGetParamsClick(Self);
btnDialEntryClick(Self);
end;
Delphi3