To detect the status of a dial-up connection, check out TAPI;especially lineInitialize and lineStatus.