Vincent Povirk : user32: Add a test to find the queue containing hotkey messages.
Alexandre Julliard
julliard at winehq.org
Tue Jun 14 11:57:47 CDT 2011
Module: wine
Branch: master
Commit: 1e2e3d1a0509f6a1f262cc204de4d278602b7a9a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1e2e3d1a0509f6a1f262cc204de4d278602b7a9a
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Mon Jun 13 12:31:08 2011 -0500
user32: Add a test to find the queue containing hotkey messages.
---
dlls/user32/tests/msg.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 2d993e2..3d9452d 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -13078,6 +13078,22 @@ static const struct message WmHotkeyReleaseLWIN[] = {
{ WM_KEYUP, sent|wparam|lparam, VK_LWIN, 0xc0000001 },
{ 0 }
};
+static const struct message WmHotkeyCombined[] = {
+ { WM_KEYDOWN, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED },
+ { WM_KEYDOWN, kbd_hook|lparam, 0, LLKHF_INJECTED },
+ { WM_KEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP },
+ { WM_KEYUP, kbd_hook|wparam|lparam, VK_LWIN, LLKHF_INJECTED|LLKHF_UP },
+ { WM_APP, sent, 0, 0 },
+ { WM_HOTKEY, sent|wparam, 5 },
+ { WM_APP+1, sent, 0, 0 },
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 1 },
+ { WM_KEYDOWN, sent|wparam|lparam, VK_LWIN, 1 },
+ { HCBT_KEYSKIPPED, hook|optional, 0, 0x80000001 },
+ { WM_KEYUP, sent, 0, 0x80000001 }, /* lparam not checked so the sequence isn't a todo */
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_LWIN, 0xc0000001 },
+ { WM_KEYUP, sent|wparam|lparam, VK_LWIN, 0xc0000001 },
+ { 0 }
+};
static int hotkey_letter;
@@ -13223,6 +13239,24 @@ static void test_hotkey(void)
DispatchMessage(&msg);
ok_sequence(WmHotkeyReleaseLWIN, "window hotkey release LWIN", FALSE);
+ /* Send and process all messages at once */
+ PostMessage(test_window, WM_APP, 0, 0);
+ keybd_event(VK_LWIN, 0, 0, 0);
+ keybd_event(hotkey_letter, 0, 0, 0);
+ keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0);
+ keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
+
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (msg.message == WM_HOTKEY)
+ {
+ ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
+ ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam);
+ }
+ DispatchMessage(&msg);
+ }
+ ok_sequence(WmHotkeyCombined, "window hotkey combined", FALSE);
+
/* Register same hwnd/id with different key combination */
ret = RegisterHotKey(test_window, 5, 0, hotkey_letter);
ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError());
More information about the wine-cvs
mailing list