Windows 7 does this in a cool way:
http://superuser.com/a/277955
It tries to load a text file over HTTP (http://www.msftncsi.com/ncsi.txt) and fetch the DNS record of dns.msftncsi.com. If the return of either is not as expected, Windows indicates 'No Internet Access' (although you are connected to a network).