The RASConnection application was developed to be a small demonstration tool that will aloow you to detect internet connection using RAS API.
There was a time I needed to detect an internet connection using the modem. I've checked the RAS library and found 2 useful functions: RasEnumConnections and RasGetConnectStatus.
To use the RAS library, you need to include in your source files and add rasapi32.lib to link with your application.