how to change network and adapter setting in a MFC program?
-
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!
-
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!
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 ...
-
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 ...
Thanks but I am not only intend to change the IP address. I am focused on changing network adapter's advanced settings.
-
Thanks but I am not only intend to change the IP address. I am focused on changing network adapter's advanced settings.
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 ;)
-
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 ;)
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: