Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 23 Jan 2007 03:27:07 -0500,    group: microsoft.public.platformsdk.networking        back       


Network connect/disconnect events...?   
OK, I've been digging around trying to find a good way to do this, and 
have managed to find several half-baked ways of doing it - hoping 
someone else has had better luck and can point me in the right direction...

I need to have my application be notified when a network connection 
(wired OR wireless) is established or lost, and be able to discern which 
network connection it was (wired - domain, wireless - SSID).  So far I 
have looked at WMI, SENS, NLA, WLAN API, and Winsock but none of these 
implementations (or code samples I've seen) seem to do much more than 
say "yep, you're connected!" or "uh-oh - no more network..." unless you 
install tons of extra SDK/DDK/API/hotfixes/etc to the client system.

Does anyone know of a simple, small, event-driven way to:

1. Have an application be notified of a change in network connectivity...

2. Let the application know what type of network it was (wired vs 
wireless)...

3. In the case of wired, provide a means of retrieving the domain that 
was connected to (ideally also the domain that was disconnected from, 
but not a requirement)...

4. In the case of wireless, provide a means of retrieving the SSID that 
was connected to (ideally also the SSID that was disconnected from, but 
not a requirement)...

5. AND use a minimal set of APIs that are native on Windows XP and don't 
require 100MB of patches/downloads to get my 500KB VB or C++ app to run!

Thanks!

-R
date: Tue, 23 Jan 2007 03:27:07 -0500   author:   arpie.b

Re: Network connect/disconnect events...?   
You do can use WMI do check the state, look at
http://www.ndis.com/faq/QA01050301/default.htm.
To receive notification for such event you can use
ExecNotificationQuery(Async)(). As API you can use
GetIfEntry() to check the state or NotifyAddrChange() or NotifyRouteChange() 
if MediaSense is on ( on by default ). For adapter's you can check with
AdapterType of Win32_NetworkAdapter ( WMI ) 
http://msdn2.microsoft.com/en-us/library/aa394216.aspx

Arkady

"arpie.b"  wrote in message 
news:urqvAhsPHHA.3624@TK2MSFTNGP05.phx.gbl...
> OK, I've been digging around trying to find a good way to do this, and 
> have managed to find several half-baked ways of doing it - hoping someone 
> else has had better luck and can point me in the right direction...
>
> I need to have my application be notified when a network connection (wired 
> OR wireless) is established or lost, and be able to discern which network 
> connection it was (wired - domain, wireless - SSID).  So far I have looked 
> at WMI, SENS, NLA, WLAN API, and Winsock but none of these implementations 
> (or code samples I've seen) seem to do much more than say "yep, you're 
> connected!" or "uh-oh - no more network..." unless you install tons of 
> extra SDK/DDK/API/hotfixes/etc to the client system.
>
> Does anyone know of a simple, small, event-driven way to:
>
> 1. Have an application be notified of a change in network connectivity...
>
> 2. Let the application know what type of network it was (wired vs 
> wireless)...
>
> 3. In the case of wired, provide a means of retrieving the domain that was 
> connected to (ideally also the domain that was disconnected from, but not 
> a requirement)...
>
> 4. In the case of wireless, provide a means of retrieving the SSID that 
> was connected to (ideally also the SSID that was disconnected from, but 
> not a requirement)...
>
> 5. AND use a minimal set of APIs that are native on Windows XP and don't 
> require 100MB of patches/downloads to get my 500KB VB or C++ app to run!
>
> Thanks!
>
> -R
date: Wed, 24 Jan 2007 10:18:33 +0200   author:   Arkady Frenkel

Re: Network connect/disconnect events...?   
Thanks for the info.  I'll take a crack at it using the references you 
supplied.  I'm especially interested in checking out the ActiveX event 
object mentioned in the first page you provided a link for.

-R

Arkady Frenkel wrote:
> You do can use WMI do check the state, look at
> http://www.ndis.com/faq/QA01050301/default.htm.
> To receive notification for such event you can use
> ExecNotificationQuery(Async)(). As API you can use
> GetIfEntry() to check the state or NotifyAddrChange() or NotifyRouteChange() 
> if MediaSense is on ( on by default ). For adapter's you can check with
> AdapterType of Win32_NetworkAdapter ( WMI ) 
> http://msdn2.microsoft.com/en-us/library/aa394216.aspx
> 
> Arkady
> 
> "arpie.b"  wrote in message 
> news:urqvAhsPHHA.3624@TK2MSFTNGP05.phx.gbl...
>> OK, I've been digging around trying to find a good way to do this, and 
>> have managed to find several half-baked ways of doing it - hoping someone 
>> else has had better luck and can point me in the right direction...
>>
>> I need to have my application be notified when a network connection (wired 
>> OR wireless) is established or lost, and be able to discern which network 
>> connection it was (wired - domain, wireless - SSID).  So far I have looked 
>> at WMI, SENS, NLA, WLAN API, and Winsock but none of these implementations 
>> (or code samples I've seen) seem to do much more than say "yep, you're 
>> connected!" or "uh-oh - no more network..." unless you install tons of 
>> extra SDK/DDK/API/hotfixes/etc to the client system.
>>
>> Does anyone know of a simple, small, event-driven way to:
>>
>> 1. Have an application be notified of a change in network connectivity...
>>
>> 2. Let the application know what type of network it was (wired vs 
>> wireless)...
>>
>> 3. In the case of wired, provide a means of retrieving the domain that was 
>> connected to (ideally also the domain that was disconnected from, but not 
>> a requirement)...
>>
>> 4. In the case of wireless, provide a means of retrieving the SSID that 
>> was connected to (ideally also the SSID that was disconnected from, but 
>> not a requirement)...
>>
>> 5. AND use a minimal set of APIs that are native on Windows XP and don't 
>> require 100MB of patches/downloads to get my 500KB VB or C++ app to run!
>>
>> Thanks!
>>
>> -R 
> 
>
date: Thu, 25 Jan 2007 20:42:32 -0500   author:   arpie.b

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us