> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jeremy Coulter
> Sent: Sunday, 4 July 1999 22:32
> To: Multiple recipients of list delphi
> Subject: [DUG]: Terminating RAS Connection
>
>
> Hi all. Does anyone know how to progmatically terminate an active RAS
> connection.
>
> I.e. I manually make a RAS connection to say the internet via
> shortcut to a
> DUN entry.
>
> I then want to terminate that connection from a program.
This is easier to do if you use a Ras component
1. Enumerate the current connections using RasEnumConnections
2. Compare the name of each connection to the one you connected with.
3. When you find the one you want, pass it to a RasHangUp call.
Example code for 3:
I:=RasHangUp(hRas);
RCStat.dwSize:=SizeOf(TRasConnStatus);
repeat
S:=RasGetConnectStatus(hRas,RCStat);
Application.ProcessMessages;
Sleep(0);
until S=ERROR_INVALID_HANDLE;
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz