Link to home
Start Free TrialLog in
Avatar of kaloyan
kaloyan

asked on

How to...

How to disconnect a Dial-up connection
using Delphi 3 procedure or s.th. else?
Avatar of inthe
inthe

hi,
are you using f.piette's components or something else?
there is a api
 RASHANGUP(1);
you could try ,but better to say which components you are using to connect
Regards Barry

Avatar of kaloyan

ASKER

The connection is build by other programm...
you'll probably have to use RasEnumConnections to find the RAS connection handle that you want to hang up, and then call RasHangUp with that handle
 Regards Barry

ps i found an example for you with a component called TRasConn

Procedure HangupRAS;
var
  RasConn  : TRasConn;
  bsize    : DWORD;
  Count    :  DWORD;

begin
  RasConn.dwSize := SizeOf(TRasConn);
  bsize := SizeOf(RASConn);
  if RASEnumConnections(@RASConn, bsize, Count) = 0 then
     if Count > 0 then RASHangUp(RASConn.hRasConn);
end;

i will have a look were trasconn is then get back :-)

ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello i just tested it works perfect :-)

Happy Hanging up
Regards Barry