• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

how? ICQ netdetect works.

My question is:

How does ICQ NDetect (or any other program with the same functionality) detect that you suddenly are connected to the intenet? (My ICQ NDetect activates when I log on to my computer. It does 'nothing' until you get connected to the internet or when you disconnect.)

I don't want any code, just let me now what technic it uses.

Does it use a timer that checkes for a connection every second? Is it this simple or can it be done any other way?

  • 2
1 Solution
saamAuthor Commented:
Edited text of question
I'm not too sure here, But I guess they use Hooks to do it.
Am I right?
Hooks are means of writing procedure that are triggers when certain events in the OS occur. for example : You can hook to the keyboard, and have your procedure run each time a key was pressed.
I hope this helps a bit...
As you guessed, it is probably done by using a timer.
In Win32 programming you can define a timer. When this timer expires, Windows sends a WM_TIMER message to your application, which in this case tries to establish a winsock connection on to a specific address in the net.

The WM_TIMER message differs from all other window messages in the way that it gets the lowest priority in the message queue to a window. Hence, this timer is often not occurate, nevertheless, it does not disturb much to the application or to windows overall performance.

Hope it helped...
saamAuthor Commented:
thanks to avico and  ShadowHawk!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now