don't close a dialog with <Return> when the OK button is disabled

svn path=/trunk/; revision=41334
This commit is contained in:
Christoph von Wittich 2009-06-07 13:27:33 +00:00
parent 12c11159c8
commit 39e6a334c2

View file

@ -2376,6 +2376,10 @@ IsDialogMessageW(
}
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)));
}