Pierre Rochon
May 4th, 1999, 09:11 AM
Hi, I want to be able, from an MFC application, to detect when an Internet connection goes on (i.e. a user logs on to the Internet) and
when Internet goes off (i.e. user logs off the Internet. In other words, with an MFC program running in the background, I want to trap
some Windows messages that will tell me when an Internet connection goes on or off.
This would be done to calculate the time spent on the Internet during the day, last week, last month, last year, etc...
Now, a problem is this. I cannot trap any connection made by the modem because some of them might be BBS's connections or
telnets or others. So I tought of many possibilities:
1) When running the setup of the program, ask for which dial-ups are Internet dialups. Allow a user to change that in the program by
placing an icon on the taskbar (that's how my program would run in the background) and that, when this icon is clicked, the program
would show the list of dial-ups defined on the PC. Then the program would track down when this dial-up runs. But how can this be
done?
2) Track any connection made by the modem and after the disconnect is done, ask if this was an Internet connection. Sounds a stupid
way to do it but it's probably the easiest way.
3) Any other suggestions?
when Internet goes off (i.e. user logs off the Internet. In other words, with an MFC program running in the background, I want to trap
some Windows messages that will tell me when an Internet connection goes on or off.
This would be done to calculate the time spent on the Internet during the day, last week, last month, last year, etc...
Now, a problem is this. I cannot trap any connection made by the modem because some of them might be BBS's connections or
telnets or others. So I tought of many possibilities:
1) When running the setup of the program, ask for which dial-ups are Internet dialups. Allow a user to change that in the program by
placing an icon on the taskbar (that's how my program would run in the background) and that, when this icon is clicked, the program
would show the list of dial-ups defined on the PC. Then the program would track down when this dial-up runs. But how can this be
done?
2) Track any connection made by the modem and after the disconnect is done, ask if this was an Internet connection. Sounds a stupid
way to do it but it's probably the easiest way.
3) Any other suggestions?