I want notification to my s/w when connected to internet
Printable View
I want notification to my s/w when connected to internet
Use
BOOL InternetCheckConnection(
IN LPCSTR lpszUrl,
IN DWORD dwFlags,
IN DWORD dwReserved
);
with lpszUrl as NULL
HTH
Ghazi
[email protected]
Dundas Software
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
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