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/d…
==============================================================================
--- 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)));
}