mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
user32: Fix VK_RETURN handling in IsDialogMessage for dialogs without an IDOK.
This commit is contained in:
parent
fe0df211a1
commit
592d994f00
@ -1221,10 +1221,8 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
|
||||
else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hwndDlg, DM_GETDEFID, 0, 0)))
|
||||
{
|
||||
HWND hwndDef = GetDlgItem(hwndDlg, LOWORD(dw));
|
||||
if (!hwndDef || !IsWindowEnabled(hwndDef))
|
||||
return TRUE;
|
||||
SendMessageW( hwndDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
|
||||
(LPARAM)GetDlgItem(hwndDlg, LOWORD(dw)));
|
||||
if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK)
|
||||
SendMessageW( hwndDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1000,6 +1000,28 @@ static INT_PTR CALLBACK TestDefButtonDlgProc (HWND hDlg, UINT uiMsg,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK TestReturnKeyDlgProc (HWND hDlg, UINT uiMsg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static int received_idok = 0;
|
||||
switch (uiMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MSG msg = {hDlg, WM_KEYDOWN, VK_RETURN, 0x011c0001};
|
||||
IsDialogMessage(hDlg, &msg);
|
||||
}
|
||||
ok(received_idok, "WM_COMMAND not received\n");
|
||||
EndDialog(hDlg, 0);
|
||||
return TRUE;
|
||||
case WM_COMMAND:
|
||||
ok(wParam==IDOK, "Expected IDOK\n");
|
||||
received_idok = 1;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void test_DialogBoxParamA(void)
|
||||
{
|
||||
INT_PTR ret;
|
||||
@ -1044,6 +1066,8 @@ static void test_DialogBoxParamA(void)
|
||||
|
||||
ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
|
||||
ok(ret == IDOK, "Expected IDOK\n");
|
||||
|
||||
DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestReturnKeyDlgProc, 0);
|
||||
}
|
||||
|
||||
static void test_DisabledDialogTest(void)
|
||||
|
Loading…
Reference in New Issue
Block a user