Dmitry Timoshkov : user32: DefDlgProc on WM_QUIT should repost it and terminate the dialog message loop .
Alexandre Julliard
julliard at winehq.org
Tue Apr 5 11:23:31 CDT 2011
Module: wine
Branch: master
Commit: bb411cfb6560c9fb0e38bbfb11493c5d8e8093b5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bb411cfb6560c9fb0e38bbfb11493c5d8e8093b5
Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date: Mon Apr 4 20:40:58 2011 +0900
user32: DefDlgProc on WM_QUIT should repost it and terminate the dialog message loop.
---
dlls/user32/dialog.c | 8 +++++++-
dlls/user32/tests/msg.c | 6 +-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index 052fbff..b7b3cce 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -805,7 +805,13 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
/* No message present -> send ENTERIDLE and wait */
SendMessageW( ownerMsg, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd );
}
- if (!GetMessageW( &msg, 0, 0, 0 )) break;
+ GetMessageW( &msg, 0, 0, 0 );
+ }
+
+ if (msg.message == WM_QUIT)
+ {
+ PostQuitMessage( msg.wParam );
+ dlgInfo->flags |= DF_END;
}
if (!IsWindow( hwnd )) return 0;
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 65e417a..4be4c38 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -10124,19 +10124,15 @@ static void test_quit_message(void)
flush_events();
flush_sequence();
ret = DialogBoxParam(GetModuleHandle(0), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0);
-todo_wine
ok(ret == 1, "expected 1, got %d\n", ret);
- ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", TRUE);
+ ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", FALSE);
memset(&msg, 0xab, sizeof(msg));
ret = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
-todo_wine
ok(ret, "PeekMessage failed\n");
-if (ret) {
ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
ok(msg.wParam == 0x1234, "wParam was 0x%lx instead of 0x1234\n", msg.wParam);
ok(msg.lParam == 0, "lParam was 0x%lx instead of 0\n", msg.lParam);
}
-}
static const struct message WmMouseHoverSeq[] = {
{ WM_MOUSEACTIVATE, sent|optional }, /* we can get those when moving the mouse in focus-follow-mouse mode under X11 */
More information about the wine-cvs
mailing list