Hi all! I am not a very smart programmer (just for hobby) so bear with me! I have written a small program with MFC to log my internet connections (date and times which are written into a file). Tha fact is that I have to open and close it manually, after I open and close the connection. What I would like to do is this: after I lauch the program, it should monitor possible connections, so that as soon as I connect with Internet it checks the time and when I close the connection it stops it. Are there functions to do this? Thank you all in advance Orlando
#include <Wininet.h> #pragma comment(lib,"wininet.lib") if (InternetGetConnectedState(INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_MODEM,0) == FALSE) { // Don't attempt connection or it will bring up the dialog } I've tried it before, it works fine! http://www.experts-exchange.com/Programming/Languages/CPP/Q_23262600.html on that link, you'll have to scroll all the way down to see the answer!