[PATCH resend] user32: Also remove WM_CHAR from queue when a menu gets VK_ESCAPE and add tests

Dmitry Timoshkov dmitry at baikal.ru
Tue Jan 24 21:15:58 CST 2017


Fabian Maurer <dark.shadow4 at web.de> wrote:

> +/* Test handling of VK_ESCAPE to close the menu */
> +static LRESULT WINAPI esc_test_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
> +{
> +    if(msg == WM_SHOWWINDOW)
> +    {
> +        PostMessageW(hwnd, WM_KEYDOWN, VK_ESCAPE, 0);
> +        HMENU hPopupMenu = CreatePopupMenu();
> +        InsertMenuA(hPopupMenu, 0, MF_STRING, 10, "test");
> +        TrackPopupMenu(hPopupMenu, 0, 0, 0, 0, hwnd, NULL);
> +        PostQuitMessage(0);
> +    }
> +
> +    if(msg == WM_CHAR || msg == WM_KEYDOWN)
> +        ok(0, "Wrong VK_ESCAPE press detected.\n");
> +
> +    return DefWindowProcA(hwnd, msg, wparam, lparam);
> +}

Please add a test to msg.c instead. This should be a normal TrackPopupMenu
test not wrapped inside of a parent's WM_SHOWWINDOW message handler. Once
there is a message test, and the underlying behaviour is well understood
a patch with a fix could be sent separately.

-- 
Dmitry.



More information about the wine-devel mailing list