take a look at internetGetConnectedState() in WinInet.dll. Unfortunately the documentation isn't very good... the best book I've found (so far) is:
Essential WinInet, by Aaron Skonnard, published by Addison Wesley Longman, Inc.
(ISBN 0-201-37936-8)
He also discusses Creating DUN entries, when a connection isn't available...
Hope this helps!
-michael
My brain hurt like a warehouse, it had no room to spare, I had to cram so many things to store everthing in there. - David Bowie