Use
InternetGetConnectedState()
[
^] to get the state. When configured and offline, you may connect using
InternetAttemptConnect(0)
[
^] (this may show the dial-up dialog).
You may also use
InternetCheckConnection()
, but this uses pings which may fail if ICMP echo request (pings) are blocked somewhere on the route to the host URL.