Howto Tell if WiFi is connected

Tech-Archive recommends: Speed Up your PC by fixing your registry



We have a situation where we need to get web page from server when device is
turned on. But WiFi card is not connected and Wininet.dll thinks everything
is copasetic till it tries to get the page. Have tried suggestion from
Televideo (TeleCLIENT), witch is to look for driver then see if we have
valid IP, but this tends to plow out the Wininet.dll when the system is
still coming up. More then likely do to the fact you have to call IOCTL
wall network is connection. Tried Microsoft suggestion with is to look for
not connected, but only works for wired network connection. So has any one
been able to salve this in a manner that do's not blow out any network stack
parts or Wininet.dll?



Here is current code snippet solution that only works with wired connection:



BOOL IsConnected(WCHAR *szURL)
{
DWORD iflags = 0;

InternetGetConnectedState(&iflags , 0);
if(0 != (iflags & INTERNET_CONNECTION_CONFIGURED))
{
SetGlobalOffline(false);
if(0 != InternetCheckConnection(szURL, FLAG_ICC_FORCE_CONNECTION, 0))
return true;
}
return false;
}

void SetGlobalOffline(BOOL fGoOffline)
{
INTERNET_CONNECTED_INFO ci;

memset(&ci, 0, sizeof(ci));
if(fGoOffline)
{
ci.dwConnectedState = INTERNET_STATE_DISCONNECTED_BY_USER;
ci.dwFlags = ISO_FORCE_DISCONNECTED;
}
else
{
ci.dwConnectedState = INTERNET_STATE_CONNECTED;
}

InternetSetOption(NULL, INTERNET_OPTION_CONNECTED_STATE, &ci,
sizeof(ci));
}

Note - this works with wired connection but not with WiFi card. Have
searched news groups and internet and found lots of other people with
similar problem.


--
Class Guy Winslow
{
public:
WINcontrols
H: 925-606-1091
M: 925-922-0222
gdwinslow@xxxxxxxxxxxxxxx
};


.



Relevant Pages

  • Re: OS slowdowns
    ... The NewGuy wrote: ... block when network resources become unavailable. ... connection, try switching locations to a wired connection to ... I'm on a wired connection. ...
    (comp.sys.mac.system)
  • Re: OS slowdowns
    ... block when network resources become unavailable. ... connection, try switching locations to a wired connection to ... I'm on a wired connection. ... read posts from Google Groups. ...
    (comp.sys.mac.system)
  • Re: OS slowdowns
    ... block when network resources become unavailable. ... connection, try switching locations to a wired connection to ... I'm on a wired connection. ... Just a single machine - no network. ...
    (comp.sys.mac.system)
  • Re: OS slowdowns
    ... block when network resources become unavailable. ... connection, try switching locations to a wired connection to ... I'm on a wired connection. ... Just a single machine - no network. ...
    (comp.sys.mac.system)
  • Re: WoW and Wifi
    ... "unlimited" data plan is actually capped at 5gb. ... He said that I could play over 200 hrs, ... $60 a month Comca$t cable connection and just getting the wifi card to play ... connection speed will allow WoW to be playable? ...
    (alt.games.warcraft)