![]() |
|
![]() | ||
|
Subject:
Network Programming in Windows
Category: Computers > Programming Asked by: harryh-ga List Price: $10.00 |
Posted:
16 Oct 2002 15:15 PDT
Expires: 15 Nov 2002 14:15 PST Question ID: 77440 |
In Windows if you unplug (or plug in) an network cable a bubble will appear by the taskbar indicating the event. How does explorer detect this event, and how can I detect this event in an application of my own? Currently I am using WMI, but this is not an optimum solution because it is a polling method. I would prefer a system where I receive a message or a callback or something like that. | |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Network Programming in Windows
From: efn-ga on 26 Oct 2002 09:18 PDT |
I'm not an expert on this, but it looks like you might be able to use the Transport Device Interface (TDI). TDI is supposed to generate an event if "an error occurs in the transport or in an underlying driver such that network I/O on this local-node address has become unreliable or impossible," and with the TDI_SET_EVENT_HANDLER IOCTL request, you can register a function to receive those events. See: http://msdn.microsoft.com/library/en-us/network/hh/network/32ioctl_4hde.asp?frame=true |
Subject:
Re: Network Programming in Windows
From: binkid-ga on 29 Oct 2002 04:35 PST |
I think you can do it in two ways (but, I haven't tried this): First using Windows 2K/XP DDK; NdisMIndicateStatus(...) API with NDIS_STATUS_MEDIA_DISCONNECT & NDIS_STATUS_MEDIA_CONNECT. When a network cable is unplugged an interrupt is generated and NIC driver reorts the change. See more at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/network/hh/network/103ndisx_5nn6.asp Second: Using GetIfEntry API declared in Iphlpapi.h. This function returns a MIB_IFROW structure. Check the dwOperStatus with staus MIB_IF_OPER_STATUS_DISCONNECTED. See Windows Platdform SDK for this API. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |