Hi,

After much searching, I am at a loss here.

How do I hangup an internet connection that my program did not create. I don't know what the connection number is; so I can't put a value in dwconnection and call InternetHangUp. InternetAutoDialHangup does not work. So, what else is there out there?

Send an AT command to the modem, somehow? Surely not?


:confused:
Posted on 2003-02-09 17:52:15 by GreenScreenAlternator
This snippet has worked well for over a year now. It's part of a program that drops the dial-up and Internet browsers on a keyboard shortcut.

Enjoy your work, P1


include \MASM32\INCLUDE\rasapi32.inc

.data?
l_RASCONN RASCONN 0FFh dup ({})
l_Buffer_Size dd ?
l_Conn_Count dd ?

Close_RAS:
;Find Active Connections.
mov l_RASCONN.dwSize, sizeof RASCONN + 1
mov l_Buffer_Size, sizeof l_RASCONN
invoke RasEnumConnections, addr l_RASCONN, addr l_Buffer_Size, addr l_Conn_Count
.if eax != 0
jmp TheEnd
.endif
invoke RasHangUp, l_RASCONN.hrasconn

TheEnd:
Posted on 2003-02-10 08:49:02 by Pone
Thank you Pone

This is exactly what I have been searching for.

I thought I must be missing something and that something is the RAS functions.

So much to learn. So little time........
Posted on 2003-02-10 13:37:49 by GreenScreenAlternator