Author: ekohl
Date: Sun Jul 12 17:16:35 2015
New Revision: 68392
URL:
http://svn.reactos.org/svn/reactos?rev=68392&view=rev
Log:
[NETCFGX]
Enable the 'Edit...' and 'Remove' buttons on the Advanced IP Settings
dialog only if the 'IP addresses' and 'Dafault gateways' lists are not
empty.
Modified:
trunk/reactos/dll/win32/netcfgx/netcfgx.c
trunk/reactos/dll/win32/netcfgx/precomp.h
trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c
Modified: trunk/reactos/dll/win32/netcfgx/netcfgx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/netcfgx.…
==============================================================================
--- trunk/reactos/dll/win32/netcfgx/netcfgx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netcfgx/netcfgx.c [iso-8859-1] Sun Jul 12 17:16:35 2015
@@ -46,6 +46,7 @@
case DLL_PROCESS_ATTACH:
netcfgx_hInstance = hinstDLL;
DisableThreadLibraryCalls(netcfgx_hInstance);
+ InitCommonControls();
break;
default:
break;
Modified: trunk/reactos/dll/win32/netcfgx/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/precomp.…
==============================================================================
--- trunk/reactos/dll/win32/netcfgx/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netcfgx/precomp.h [iso-8859-1] Sun Jul 12 17:16:35 2015
@@ -19,6 +19,7 @@
#include <setupapi.h>
#include <netcfgn.h>
#include <devguid.h>
+#include <commctrl.h>
#include "resource.h"
Modified: trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/tcpipcon…
==============================================================================
--- trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] Sun Jul 12 17:16:35
2015
@@ -665,6 +665,31 @@
}
}
+static
+VOID
+EnableIpButtons(
+ HWND hwndDlg)
+{
+ BOOL bEnable;
+
+ bEnable = (ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_IPLIST)) != 0);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_IPMOD), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_IPDEL), bEnable);
+}
+
+static
+VOID
+EnableGwButtons(
+ HWND hwndDlg)
+{
+ BOOL bEnable;
+
+ bEnable = (ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_GWLIST)) != 0);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GWMOD), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GWDEL), bEnable);
+}
VOID
InitializeTcpipAdvancedIpDlg(
@@ -696,6 +721,7 @@
else
{
InsertIpAddressToListView(GetDlgItem(hwndDlg, IDC_IPLIST),
This->pCurrentConfig->Ip, TRUE);
+ EnableIpButtons(hwndDlg);
}
InsertColumnToListView(GetDlgItem(hwndDlg, IDC_GWLIST), IDS_GATEWAY, 0, 100);
@@ -703,6 +729,8 @@
InsertColumnToListView(GetDlgItem(hwndDlg, IDC_GWLIST), IDS_METRIC, 1, (rect.right -
rect.left - 100));
InsertIpAddressToListView(GetDlgItem(hwndDlg, IDC_GWLIST),
This->pCurrentConfig->Gw, FALSE);
+ EnableGwButtons(hwndDlg);
+
SendDlgItemMessageW(hwndDlg, IDC_METRIC, EM_LIMITTEXT, 4, 0);
}
@@ -1329,6 +1357,8 @@
li.pszText = Ip.szMask;
SendDlgItemMessageW(hwndDlg, IDC_IPLIST, LVM_SETITEMW, 0,
(LPARAM)&li);
}
+
+ EnableIpButtons(hwndDlg);
}
}
else if (LOWORD(wParam) == IDC_IPMOD)
@@ -1361,6 +1391,7 @@
else if (LOWORD(wParam) == IDC_IPDEL)
{
DeleteItemFromList(GetDlgItem(hwndDlg, IDC_IPLIST));
+ EnableIpButtons(hwndDlg);
break;
}
else if (LOWORD(wParam) == IDC_GWADD)
@@ -1395,6 +1426,8 @@
}
}
}
+
+ EnableGwButtons(hwndDlg);
}
break;
}
@@ -1443,6 +1476,7 @@
else if (LOWORD(wParam) == IDC_GWDEL)
{
DeleteItemFromList(GetDlgItem(hwndDlg, IDC_GWLIST));
+ EnableGwButtons(hwndDlg);
break;
}
}