Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Detect network connection?

Detect network connection?

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lynchspawn
    wrote on last edited by
    #1

    Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

    B P L D T 5 Replies Last reply
    0
    • L lynchspawn

      Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      If you only have to run on servers, you might be interested in the Network Monitor API: Network Monitor captures network traffic for display and analysis. It enables you to perform tasks such as analyzing previously captured data in user-defined methods and extract data from defined protocol parsers. No shirt, no shoes, no brains, no service.

      1 Reply Last reply
      0
      • L lynchspawn

        Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

        P Offline
        P Offline
        PJ Arends
        wrote on last edited by
        #3

        InternetGetConnectedState


        "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!

        1 Reply Last reply
        0
        • L lynchspawn

          Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

          L Offline
          L Offline
          lynchspawn
          wrote on last edited by
          #4

          Thanks guys - I don't think either one will work though. The reason why InternetGetConnectedState won't work is that it seems to only detect if a connection to the internet is found. This won't be true since by default, any new PC will not be allowed to connect to the internet from within our building (MAC filtering). What I need is a way to determine if the connection is good for a particular interface. Similar to what the connection status icon does in XP. For now, I'm using a ping to our server name. I guess it's about as good as I will be able to do. If anyone has a better suggestion, please let me know.

          1 Reply Last reply
          0
          • L lynchspawn

            Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Is this of any help?


            "Take only what you need and leave the land as you found it." - Native American Proverb

            1 Reply Last reply
            0
            • L lynchspawn

              Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              lynchspawn wrote:

              Any idea how they are doing it?

              ISensNetwork

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups