How can i test if the machine is connected to the internet, without windows prompting the user for a connection?

starting winsock and trying to connect to some website at port 80 or something similar will prompt.

I know there's some method to check for active RAS connections, is there a more general method??

thanks in advance,
ROCKaMIC