You need to use "GetIpAddrTable" and then look at wType to see if it is MIB_IPADDR_DISCONNECTED.
This just reminded me........
I was making fun of my Linux fanatic friend. I said you can tell the difference between a Windows and Linux programmer by how they approach a task.
If the task is to tell if you are connected to a network.
The windows programmer will call an API function to find out the network card state.
A Linux programmer will monitor the LED blinking on the network card with a webcam, pipe it to a file then regex the file to see if the LED is on
He scowled. Thought about it and then said, with a smile,. "Nope. We'd get an intern to watch the LED and SMS us on the yacht when it changes" - Touche!.