|
-
June 3rd, 1999, 08:13 AM
#1
How to detect when we connect to internet
I want notification to my s/w when connected to internet
-
June 18th, 1999, 03:38 PM
#2
Re: How to detect when we connect to internet
Use
BOOL InternetCheckConnection(
IN LPCSTR lpszUrl,
IN DWORD dwFlags,
IN DWORD dwReserved
);
with lpszUrl as NULL
HTH
Ghazi
[email protected]
Dundas Software
-
June 19th, 1999, 11:01 PM
#3
Re: How to detect when we connect to internet
I've been using this successfully
DWORD lpdwFlags ;//= INTERNET_CONNECTION_MODEM|INTERNET_CONNECTION_LAN|INTERNET_CONNECTION_PROXY ;
if( InternetGetConnectedState(&lpdwFlags ,0) == TRUE){ ....}
maybe - InternetCheckConnection works as well, but I thought it checked to see if you could connect.. Oh well
Regards
Colin Davies
At the Mount
-
June 20th, 1999, 03:12 PM
#4
Re: How to detect when we connect to internet
Hi,
I had once the same problem. Here the code to get the connections open to the net.
If the enumeration returns NOT 0, there is no connection. Else you can even see which ones are open.
RASCONN ras[20];
DWORD dSize,dNumber,dCount;
ras[0].dwSize = sizeof(RASCONN);
dSize = sizeof( ras ); // Get active RAS - Connection
if( RasEnumConnections( ras, &dSize, &dNumber ) == 0 )
{
for( dCount = 0; dCount < dNumber; dCount++ )
{
do something
}
}
Have fun
Dan
Dan
--------------------------------------
It's always nice to see, whether the hints work. I appreciate feedback
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|