DECLARE SHORT InternetGetConnectedState IN WININet.DLL ; INTEGER @lpdwFlags, ; INTEGER dwReserved nFlags = 0 nResult = InternetGetConnectedState(@nFlags, 0)returns 1 on success, 0 if failed, and you need to check the flag values returned in the parameter nFlags using the values in WININET.H; 1 indicates a modem connection, 2 a LAN connection, 4 a proxy server connection, 8 modem in use busy, and zero means no connection exists. I've gotten incorrect results when DUN was trying to establish a link; it reported a connection even though it was in the process of dialing.