How to detect lost Windows Network connection?


I have established a connect and disconnect functionality using the WNetAddConnection2 and WNetCancelConnection2. Everything works fine and I can detect and cater for the errors whenever they occur with connection and disconnection. The problem came when I wanted to add a function to detect whenever a connection is lost, and attempt to reconnect. I've reviewed the msdn library and it turned up a sizeable variety or 'get' type functions which retrieve provider, resource or login attributes pertaining to a connection. Which one should I use, or is there another more appropriate method Thanks.


Answer this question

How to detect lost Windows Network connection?