Hi Stefan,
Appreciate the quick reply. However, my computer is connected to the internet via LAN and also has a fax modem. When I run the code below, it simply states "LAN Connection available". I want to be able to communicate with the modem to see if there is a dail-tone available to send a fax.
Thanks
Keashdoc
> > Hi,
> >
> > I was wondering if there was any activex or Win32 API routine that will allow me to communicate with the computer fax-modem to see if the phone line is in use. Specifically, I want to make sure that the phone line is "available" and not in use before transmitting a fax via the computer.
> >
> Hi Keashdoc -
>
> Perhaps the InternetGetConnectedState() API function might help, see also InternetGetConnectedStateEx():
>
http://www.news2news.com/vfp/>
>
>
> #define INTERNET_CONNECTION_MODEM 1
> #define INTERNET_CONNECTION_LAN 2
> #define INTERNET_CONNECTION_PROXY 4
> #define INTERNET_CONNECTION_MODEM_BUSY 8
> #define INTERNET_RAS_INSTALLED 16
> #define INTERNET_CONNECTION_OFFLINE 32
> #define INTERNET_CONNECTION_CONFIGURED 64
>
> CLEAR
>
> LOCAL lnFlag
> lnFlag = 0
>
> DECLARE Integer InternetGetConnectedState ;
> IN wininet.dll ;
> Integer@, ;
> Integer
>
> IF InternetGetConnectedState(@lnFlag,0) = 0
> ? "No connection at all"
> ELSE
> IF BITOR(m.lnFlag, INTERNET_CONNECTION_MODEM) = m.lnFlag
> ? "Modem connection available"
> ENDIF
> IF BITOR(m.lnFlag, INTERNET_CONNECTION_LAN) = m.lnFlag
> ? "LAN connection available"
> ENDIF
> IF BITOR(m.lnFlag, INTERNET_CONNECTION_OFFLINE) = m.lnFlag
> ? "Connection is off-line"
> ENDIF
> ENDIF
>
>
>
>
>
> hth
> -Stefan