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. how to change network and adapter setting in a MFC program?

how to change network and adapter setting in a MFC program?

Scheduled Pinned Locked Moved C / C++ / MFC
c++htmlcomsysadminhelp
5 Posts 3 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.
  • R Offline
    R Offline
    Robert Mao
    wrote on last edited by
    #1

    Does anyone know how to change network and adapter setting in a MFC program? It can be easily done by hand, just right click on a network connection and select "Properties" to make changes. However how to do that in a program? I found a very useful program by IBM, named "Access Connection" (http://www.pc.ibm.com/qtechinfo/MIGR-4ZLNJB.html?doctype=Downloadable+files) can do this. I am trying to write a simular program. Any help is appreciated!

    B 1 Reply Last reply
    0
    • R Robert Mao

      Does anyone know how to change network and adapter setting in a MFC program? It can be easily done by hand, just right click on a network connection and select "Properties" to make changes. However how to do that in a program? I found a very useful program by IBM, named "Access Connection" (http://www.pc.ibm.com/qtechinfo/MIGR-4ZLNJB.html?doctype=Downloadable+files) can do this. I am trying to write a simular program. Any help is appreciated!

      B Offline
      B Offline
      Boris Schuetz
      wrote on last edited by
      #2

      I hope this is what you are searching ... eg. to alter the ip - adress You need to open a key like (for WinNT): sKey = _T("SOFTWARE\\Microsoft\\ Windows NT\\CurrentVersion\\NetworkCards"); res = RegOpenKeyEx(HKEY_LOCAL_MACHINE, sKey, 0, KEY_READ, &hKey); if (res != ERROR_SUCCESS) goto LAB_X; - Imake it a little bit shorter - then enumerate the adapter of your choice by RegEnumKeyEx the 'ServiceName' - key ist the important - it is something like '{EE0A056F-1C40-4995-B7EB-E47E2C1E0A27}' combine the path to the service-interface 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\' with the '{EE0A056F-1C40-4995-B7EB-E47E2C1E0A27}' and you will find the key 'IPAddress'. it is a MULTI_SZ, so editing is a little bit harder - but change the value and it is applied good luck ...

      R 1 Reply Last reply
      0
      • B Boris Schuetz

        I hope this is what you are searching ... eg. to alter the ip - adress You need to open a key like (for WinNT): sKey = _T("SOFTWARE\\Microsoft\\ Windows NT\\CurrentVersion\\NetworkCards"); res = RegOpenKeyEx(HKEY_LOCAL_MACHINE, sKey, 0, KEY_READ, &hKey); if (res != ERROR_SUCCESS) goto LAB_X; - Imake it a little bit shorter - then enumerate the adapter of your choice by RegEnumKeyEx the 'ServiceName' - key ist the important - it is something like '{EE0A056F-1C40-4995-B7EB-E47E2C1E0A27}' combine the path to the service-interface 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\' with the '{EE0A056F-1C40-4995-B7EB-E47E2C1E0A27}' and you will find the key 'IPAddress'. it is a MULTI_SZ, so editing is a little bit harder - but change the value and it is applied good luck ...

        R Offline
        R Offline
        Robert Mao
        wrote on last edited by
        #3

        Thanks but I am not only intend to change the IP address. I am focused on changing network adapter's advanced settings.

        B 1 Reply Last reply
        0
        • R Robert Mao

          Thanks but I am not only intend to change the IP address. I am focused on changing network adapter's advanced settings.

          B Offline
          B Offline
          Boris Schuetz
          wrote on last edited by
          #4

          Metric is in the same folder, subnetmask, Gateway, ... just alter the values in the registry. If it works you can programm it ... Activation and Disabling of the adapter is a little bit tricky. Maybe I totally misunderstood by ;)

          H 1 Reply Last reply
          0
          • B Boris Schuetz

            Metric is in the same folder, subnetmask, Gateway, ... just alter the values in the registry. If it works you can programm it ... Activation and Disabling of the adapter is a little bit tricky. Maybe I totally misunderstood by ;)

            H Offline
            H Offline
            Halid Niyaz
            wrote on last edited by
            #5

            Is there any API provide such things? If we have any API it will be more helpful. or Does it have any other way to do this? Pls help me. Thanx in advance. regards Halid:confused:

            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