Solved

Hanging up Modem

Posted on 2001-07-21
2
148 Views
Last Modified: 2012-05-04
Hello,
I have coded a small program which will hang up the modem after a certain number of minutes, but theres one problem, i dont know how to hang up the modem! Its a dial up connection if you need to know.

Any help?

thanks
0
Comment
Question by:St3v13
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 6304928
hi,
you can get the latest Ras headers converted to delphi from:
ftp://delphi-jedi.org/api/RAS.zip

install then can do:

uses ras;

procedure TForm1.Button1Click(Sender: TObject);
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;

Regards Barry
0
 

Author Comment

by:St3v13
ID: 6305004
thanks barry! its work great!

Regards Stephen
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now