[ros-diffs] [cwittich] 41334: don't close a dialog with <Return> when the OK button is disabled

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Jun 7 15:27:34 CEST 2009


Author: cwittich
Date: Sun Jun  7 17:27:33 2009
New Revision: 41334

URL: http://svn.reactos.org/svn/reactos?rev=41334&view=rev
Log:
don't close a dialog with <Return> when the OK button is disabled

Modified:
    trunk/reactos/dll/win32/user32/windows/dialog.c

Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/dialog.c?rev=41334&r1=41333&r2=41334&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Sun Jun  7 17:27:33 2009
@@ -2376,6 +2376,10 @@
                  }
                  else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0)))
                  {
+                    HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw));
+                    if (!hwndDef || !IsWindowEnabled(hwndDef))
+                        return TRUE;
+
                      SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
                                      (LPARAM)GetDlgItem(hDlg, LOWORD(dw)));
                  }



More information about the Ros-diffs mailing list