https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f349ab3c28a6e13c671b0393fee4784d1ef218e

commit 8f349ab3c28a6e13c671b0393fee4784d1ef218e
Author:     Eric Kohl <eric.k...@reactos.org>
AuthorDate: Sun Dec 17 21:50:20 2023 +0100
Commit:     Eric Kohl <eric.k...@reactos.org>
CommitDate: Sun Dec 17 21:50:20 2023 +0100

    [NETCFGX] Create only one "Alternative Configuration" tab
    
    - Check for the presence of the second tab.
    - Remove unnecessary checks for checked radiobuttons.
    
    CORE-19328
---
 dll/win32/netcfgx/tcpipconf_notify.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/dll/win32/netcfgx/tcpipconf_notify.c 
b/dll/win32/netcfgx/tcpipconf_notify.c
index e6db3ae9a1d..d662f7fdf33 100644
--- a/dll/win32/netcfgx/tcpipconf_notify.c
+++ b/dll/win32/netcfgx/tcpipconf_notify.c
@@ -2648,7 +2648,7 @@ TcpipBasicDlg(
                 switch (LOWORD(wParam))
                 {
                     case IDC_USEDHCP:
-                        if (IsDlgButtonChecked(hwndDlg, IDC_USEDHCP) == 
BST_CHECKED)
+                        if (SendMessageW(GetParent(hwndDlg), PSM_INDEXTOID, 1, 
0) == 0)
                         {
                             PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                             SendDlgItemMessageW(hwndDlg, IDC_IPADDR, 
IPM_CLEARADDRESS, 0, 0);
@@ -2662,7 +2662,7 @@ TcpipBasicDlg(
                         }
                         break;
                     case IDC_NODHCP:
-                        if (IsDlgButtonChecked(hwndDlg, IDC_NODHCP) == 
BST_CHECKED)
+                        if (SendMessageW(GetParent(hwndDlg), PSM_INDEXTOID, 1, 
0) != 0)
                         {
                             PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                             EnableWindow(GetDlgItem(hwndDlg, IDC_IPADDR), 
TRUE);
@@ -2680,22 +2680,16 @@ TcpipBasicDlg(
                         }
                         break;
                     case IDC_AUTODNS:
-                        if (IsDlgButtonChecked(hwndDlg, IDC_AUTODNS) == 
BST_CHECKED)
-                        {
-                            PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
-                            SendDlgItemMessageW(hwndDlg, IDC_DNS1, 
IPM_CLEARADDRESS, 0, 0);
-                            SendDlgItemMessageW(hwndDlg, IDC_DNS2, 
IPM_CLEARADDRESS, 0, 0);
-                            EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), FALSE);
-                            EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), FALSE);
-                        }
+                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+                        SendDlgItemMessageW(hwndDlg, IDC_DNS1, 
IPM_CLEARADDRESS, 0, 0);
+                        SendDlgItemMessageW(hwndDlg, IDC_DNS2, 
IPM_CLEARADDRESS, 0, 0);
+                        EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), FALSE);
+                        EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), FALSE);
                         break;
                     case IDC_FIXEDDNS:
-                        if (IsDlgButtonChecked(hwndDlg, IDC_FIXEDDNS) == 
BST_CHECKED)
-                        {
-                            PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
-                            EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), TRUE);
-                            EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), TRUE);
-                        }
+                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+                        EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), TRUE);
+                        EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), TRUE);
                         break;
                     case IDC_ADVANCED:
                         LaunchAdvancedTcpipSettings(hwndDlg, 
(TcpipConfNotifyImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER));

Reply via email to